Is it possible to output a hashtable from an Azure DevOps YAML Pipeline PowerShell Task, store it to a pipeline variable and then pass the hashtable to a second PowersShell task? The receiving Script is running the 'New-AzResourceGroupDeployment' commandlet with "-TemplateParameterObject", which requires a hashtable as the argument.
I have only been able to pass strings to and from pipeline variables. I believe this proves that my syntax for outputting and receiving the variables between stages/tasks is correct. My understanding is that Azure DevOps pipeline variables store strings and there is no way for the engine to recognize a PowerShell hashtable. Is that correct?
Has anyone been able to pass a hashtable as a pipeline variable?
Here is the code which outputs the hashtable:
$TemplateSecretObject = @{
keyVaultObject = $KeyVaultObject
keyVaultSecretObject = $KeyVaultSecretObject
}
Write-Host "##vso[task.setvariable variable=keyVaultSecretTaskOutput;isOutput=true]$TemplateSecretObject"