How do you add to a JSON array in PowerShell? I'm trying with the following code, but it's complaining with a "Collection was of a fixed size" exception:
$json = @"
[
{
"name": "First"
},
{
"name": "Second"
}
]
"@
$toAdd =@"
{
"name": "Third"
}
"@
$jobj = ConvertFrom-Json -InputObject $json
$jobj.Add((ConvertFrom-Json -InputObject $toAdd))