title: How to set Azure DevOps pipeline variable with Powershell
body: <p>I currently have a variable in my release pipeline and need to set its value through a Powershell script. The purpose is to have its value available to be used for postman collections in next tasks.</p>
  <p>I'm trying to do that in this way but not working.</p>
  <pre><code>$content = Get-Content -Path .\token.txt
  
  Write-Host &quot;RP token found: $content&quot;
  
  Write-Host &quot;##vso[task.setvariable variable=readingProgressToken;]$content&quot;
  
  Write-Host &quot;Variable value in pipeline: $(readingProgressToken)&quot;
  </code></pre>
  <p>And this is the variable
  <a href="https://i.stack.imgur.com/waq73.png" rel="nofollow noreferrer">variable</a></p>