Visual Studio 15.6 which was recently released (https://blogs.msdn.microsoft.com/visualstudio/2018/03/06/visual-studio-2017-version-15-6-visual-studio-for-mac-version-7-4-released) breaks / Powershell JSON handling
Issue 1:
"[{x:'b'},{x:'a'}]" | ConvertFrom-Json | ConvertTo-Json
before VS 15.6 used to return
[
{
"x": "b"
},
{
"x": "a"
}
]
With VS 15.6 installed returns
{
"value": [
{
"x": "b"
},
{
"x": "a"
}
],
"Count": 2
}
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.248
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.248
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue 2:
"[{x:'b'},{x:'a'}]" | ConvertFrom-Json | Sort-Object -Property x
before VS 15.6 used to return
x
-
a
b
With VS 15.6 installed returns
x
-
b
a
> $PSVersionTable
Name Value
---- -----
PSVersion 5.1.16299.248
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.16299.248
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
I have a VM with VS 15.5.6 installed and can say there is no difference between my dev laptop that has VS 15.6.1
What you describe as expected is what I get in PowerShell 6 (both machines), and what you describe as actual, I get on Windows PowerShell 5.1 on both machines. Note that this repo is only for issues of PowerShell 6.
To add to @bergmeister's comment: The issue you describe was fixed in _Core_ a while back (but still exists in _Windows PowerShell_ v5.1): #3153
As stated in the bug template:
For Windows PowerShell 5.1 issues, suggestions, or feature requests please use the following link instead:
- Windows PowerShell UserVoice