Steps to reproduce
> '{"$id": 1, "$type": "System.String", "id": "value"}' | ConvertFrom-Json
- Add
$id and $type properties to a json object
- Pipe object to
ConvertFrom-Json Cmdlet
- Notice that
$id and $type properties are missing from resulting PSCustomObject
Expected behavior
ConvertFrom-Json does not ignore properties when deserializing into generic PSCustomObject, regardless of their name.
> '{"$id": 1, "$type": "System.String", "id": "value"}' | ConvertFrom-Json
$id $type id
--- ----- --
1 System.String value
Actual behavior
> '{"$id": 1, "$type": "System.String", "id": "value"}' | ConvertFrom-Json
id
--
value
Additional Notes
- Issue does not occur when metadata properties are deeper in the hierarchy.
- Other
Newtonsoft.Json metadata properties include $values and $ref.
Environment data
> $PSVersionTable
Name Value
---- -----
PSVersion 6.1.0-preview.3
PSEdition Core
GitCommitId v6.1.0-preview.3
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Steps to reproduce
$idand$typeproperties to a json objectConvertFrom-JsonCmdlet$idand$typeproperties are missing from resultingPSCustomObjectExpected behavior
ConvertFrom-Jsondoes not ignore properties when deserializing into genericPSCustomObject, regardless of their name.Actual behavior
Additional Notes
Newtonsoft.Jsonmetadata properties include$valuesand$ref.Environment data