How to force array with one element to generate square brackets in json
I'm trying to create a JSON array using: $bodyObject = @( @{ 'Username' = '[email protected]' } ) $body = $bodyObject | ConvertTo-Json But the $body object doesn't contain the square brackets: { "Username": "[email protected]" } If I add another element…