Prerequisites
Steps to reproduce
Having a json file containing this:
// Comment on top level
{
"key": "value"
}
should become a PSObject or Hashtable, when imported using Get-Content and then piped through ConvertFrom-Json, but the result is an array with a null as first element and the PSObject/Hashtable as the second element!
Expected behavior
Comment lines have to be ignored, not be included as null elements.
Actual behavior
Comments on top level are interpreted as null elements like a "{}".
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
Having a json file containing this:
should become a PSObject or Hashtable, when imported using Get-Content and then piped through ConvertFrom-Json, but the result is an array with a null as first element and the PSObject/Hashtable as the second element!
Expected behavior
Comment lines have to be ignored, not be included as null elements.Actual behavior
Comments on top level are interpreted as null elements like a "{}".Error details
No response
Environment data
Visuals
No response