I have a json file (test.json) that looks something like this:
{
\"root\":
{
\"key\":\"value\"
}
}
I\'m loading it into
The example was for a relatively shallow source object (not nested objects in the properties).
Here's a version that will go 2 levels deep into the source object, and should work with your data:
$data = @{}
foreach ($propL1 in $x.psobject.properties.name)
{
$data[$propL1] = @{}
foreach ($propL2 in $x.$propL1.psobject.properties.name)
{
$data[$PropL1][$PropL2] = $x.$propL1.$propL2
}
}
$data.root.keys
key