I am trying to update Azure pipeline group variable from within a PowerShell script using the az cli.
I have the command updating the variable but its modifying the json and removing all the quotes (")
so instead of updating variable from
{"a": "a"}
to
{"a": "b"}
it updates it to {a: b}
I am running the following command
$json = ConvertTo-Json $a -Compress
Write-Host $json
az pipelines variable-group variable update --group-id 236 --name MyJson --detect true --secret false --value $json
The outut of the write-host is
{"a": "b"}
Output of the the az pipelines variable-group variable update is
{
"MyJson": {
"isSecret": null,
"value": "{a:b}"
}
}
What am I doing wrong and how can I get it to update without modifying the JSON?
