I'm getting results of a query from a TFS Api call that comes to the Shell in JSON format. Powershell then puts those results in a PScustomObject. I normally take those results and use them to perform an update to the service hosting the Json payload. The problem I sometimes have is that the resulting object is rather deep in terms of a nested JSon / object structure. Which leads me to my question.
You really can't. .NET doesn't see this as "depth," per se; it's an object, with properties, some of which are actually collections of other objects. Until you recurse the entire thing, you can't know how far it goes. .NET just doesn't conceptualize objects that way.
It's interesting that you don't have this Depth option on importing json but exporting you do.. Why is that?
(gcm convertfrom-json ).parameters.keys