I have a json file (test.json) that looks something like this:
{
\"root\":
{
\"key\":\"value\"
}
}
I\'m loading it into
I put this together to handle nested json to hashtables
function ConvertJSONToHash{
param(
$root
)
$hash = @{}
$keys = $root | gm -MemberType NoteProperty | select -exp Name
$keys | %{
$key=$_
$obj=$root.$($_)
if($obj -match "@{")
{
$nesthash=ConvertJSONToHash $obj
$hash.add($key,$nesthash)
}
else
{
$hash.add($key,$obj)
}
}
return $hash
}
I have only tested with 4 levels but recursive until it has complete hashtable.