title: PowerShell Hashtable as Azure Devops YAML Pipeline output Variable
body: <p>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 &quot;-TemplateParameterObject&quot;, which requires a hashtable as the argument.</p>
  <p>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?</p>
  <p>Has anyone been able to pass a hashtable as a pipeline variable?</p>
  <p>Here is the code which outputs the hashtable:</p>
  <pre><code>$TemplateSecretObject = @{
     keyVaultObject       = $KeyVaultObject
     keyVaultSecretObject = $KeyVaultSecretObject
  }
  Write-Host &quot;##vso[task.setvariable variable=keyVaultSecretTaskOutput;isOutput=true]$TemplateSecretObject&quot;
  </code></pre>