I have to set an array for an ARM Template within my Azure DevOps pipeline. I set my variable like this:
$foo = '["' + 'bar' + '"]'
Write-Host $foo
#######Assign Variables with Correct Value in pipeline
Write-Host "##vso[task.setvariable variable=fooVariableInPipeline]$foo"
The $foo value is fine which would be ["bar"] as expected. But when I inspect the value in the next tasks after setting the variable, it would remove the quotation marks and show the value as [bar].
This is rather strange and I am wondering if its me or is it a bug? Any workarounds?
For the time being, I have updated my file directly using powershell code.