Prerequisites
Steps to reproduce
Because the return type of ConvertFrom-Json -AsHashTable changed from [HashTable] to [OrderedHashtable], any code explicitly checking that the return type equals [Hashtable] using -eq (rather than -is) will likely break.
To avoid breaking existing code, consider reverting -AsHashtable functionality to return a [Hashtable] and adding a separate switch for -AsOrderedHashtable.
Expected behavior
> ('{ "name": "Id", "value": 1 }' | ConvertFrom-Json -AsHashTable).GetType() -eq [Hashtable]
True
Actual behavior
> ('{ "name": "Id", "value": 1 }' | ConvertFrom-Json -AsHashTable).GetType() -eq [Hashtable]
False
Error details
No response
Environment data
Name Value
---- -----
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.0
OS Microsoft Windows 10.0.22000
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
Because the return type of
ConvertFrom-Json -AsHashTablechanged from[HashTable]to[OrderedHashtable], any code explicitly checking that the return type equals[Hashtable]using-eq(rather than-is) will likely break.To avoid breaking existing code, consider reverting
-AsHashtablefunctionality to return a[Hashtable]and adding a separate switch for-AsOrderedHashtable.Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
No response