Skip to content

Instantly share code, notes, and snippets.

@bandit145
Last active April 15, 2018 22:06
Show Gist options
  • Save bandit145/e2c301f069e345723bf4f91734f043e6 to your computer and use it in GitHub Desktop.
Save bandit145/e2c301f069e345723bf4f91734f043e6 to your computer and use it in GitHub Desktop.
ConvertTo-Json seems to be very broken and flattens nested arrays into strings
#PSVersion 5.1.14393.1770
$test = @{testarr=@(@{links=@(1,2)})}
$test
$test | ConvertTo-Json
$test | ConvertTo-Json | ConvertFrom-Json
($test | ConvertTo-Json | ConvertFrom-Json).testarr[0].links
($test | ConvertTo-Json | ConvertFrom-Json).testarr[0].links[1]
Write-Output "Not an array :("
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment