Last active
April 15, 2018 22:06
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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