Powershell ConvertTo-json with embedded hashtable

后端 未结 2 1431
醉梦人生
醉梦人生 2020-11-30 06:45

I\'m having a problem with ConvertTo-Json and was trying to understand the behavior and/or what I\'m doing wrong.

Consider this sequence of commands:



        
相关标签:
2条回答
  • 2020-11-30 06:56
    -Depth $([int32]::MaxValue)
    

    specifies infinite depth (maximum possible for ConvertTo-Json cmdlet)

    0 讨论(0)
  • 2020-11-30 07:17

    It's a trouble with the depth, the default value is 2, can you try :

    ConvertTo-json @($val) -Depth 5
    
    0 讨论(0)
提交回复
热议问题