TIL about an unexpected behavior in powershell's ConvertTo-Json
Today I learned about an unexpected behavior in powershell’s ConvertTo-Json
. When you pipe more than one object to the ConvertTo-Json
cmdlet the output is an array of objects, as expected. When one object, or an array with a single object, is piped to it a single object is outputted.