Why does powershell give different result in one-liner than two-liner when converting JSON?
Clash Royale CLAN TAG #URR8PPP Why does powershell give different result in one-liner than two-liner when converting JSON? Overview From a powershell 3 prompt,, I want to call a RESTful service, get some JSON, and pretty-print it. I discovered that if I convert the data to a powershell object, and then convert the powershell object back to json, I get back a nice pretty-printed string. However, if I combine the two conversions into a one-liner with a pipe I will get a different result. TL;DR: this: PS> $psobj = $orig | ConvertFrom-JSON PS> $psobj | ConvertTo-JSON ... gives me different result than this: PS> $orig | ConvertFrom-JSON | ConvertTo-JSON Original data [ { "Type": "1", "Name": "QA" }, { "Type": "2", "Name": "whatver" } ] Doing the conversion in two steps I'm going to remove the whitespace (so it fits on one line...), convert it to a powershell object, and then...