You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Proposal is to make -AsHashtable actually return an OrderedDictionary. I believe from PS script usage, there should not be any impact even if the type changes. Alternative would be to add a -Ordered switch used with -AsHashtable or a -AsOrderedDictionary in a different parameterset from -AsHashtable but this seems unnecessary and most of the time, I would expect users converting from JSON would want to preserve order making it more readable.
Summary of the new feature / enhancement
Currently, when using
ConvertFrom-Json -AsHashtable, you get an unordered hashtable where the properties don't match the order defined in the JSON.Expected:
Actual:
Proposed technical implementation details (optional)
Proposal is to make
-AsHashtableactually return an OrderedDictionary. I believe from PS script usage, there should not be any impact even if the type changes. Alternative would be to add a-Orderedswitch used with-AsHashtableor a-AsOrderedDictionaryin a different parameterset from-AsHashtablebut this seems unnecessary and most of the time, I would expect users converting from JSON would want to preserve order making it more readable.