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:
It's a trouble with the depth, the default value is 2, can you try :
ConvertTo-json @($val) -Depth 5