title: Azure DevOps Release Pipeline - How to set and pass values in variables in pipeline with Azure Powershell
body: <p>With Azure Release Pipeline, in a task using the PowerShell Script, I am able to set values of variables and pass to next task using the command </p>
  
  <pre><code>Write-Host '##vso[task.setvariable variable=varResourceExists;isOutput=true;something'
  </code></pre>
  
  <p>However, when I put this similar command in a task that uses Azure PowerShell, this command is no longer allowed, the task produces a warning:</p>
  
  <blockquote>
    <p>2019-10-22T00:23:14.3080614Z ##[warning]'##vso[task.setvariable
    variable=varResourceExists;isOutput=true;something' contains logging
    command keyword '##vso', but it's not a legal command. Please see the
    list of accepted commands:
    <a href="https://go.microsoft.com/fwlink/?LinkId=817296" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?LinkId=817296</a></p>
  </blockquote>
  
  <p>As a result, the variable varResourceExists cannot be set by my task. I have also tried a conventional PowerShell set value by doing </p>
  
  <pre><code>$varResourceExists = 'something'; # this also does not work
  </code></pre>
  
  <p>Is there a way I can set this value in Azure Powershell script so that the next task can reference it?</p>