title: How to use output variable value from one powershell script to another powershell script
body: <p>Hi All I'm working on ymal release pipeline where I have two PowerShell script.
  test1.ps1
  test2.ps1</p>
  <p>step 1)
  In test1.ps1 I'm setting a output variable using :</p>
  <p>$link=&quot;google.com&quot;</p>
  <p>Write-Host &quot;##vso[task.setvariable variable=packageurl]$link&quot;</p>
  <p>step 2)
  Now I want to use this pacakgeurl variable value in test2.ps1 script.</p>
  <p>Ymal code will look like :</p>
  <pre class="lang-yaml prettyprint-override"><code>- task: AzurePowerShell@3
  
        displayName: 'Query Latest Package'
  
        inputs:
          azureSubscription: 'test1'
          ScriptType: FilePath
          ScriptPath: 'source\test1.ps1'
  
  - task: PowerShell@2
  
        displayName: 'Download package' 
        inputs:
          targetType: filePath 
          filePath: 'source\test2.ps1'
  </code></pre>
  <p>So basically I have to use the output variable value from 1 task to 2 task via PowerShell script.</p>
  <p>I also tried to follow this link : <a href="https://developercommunity.visualstudio.com/content/problem/676342/how-to-use-output-variable-from-a-powershell-scrip.html" rel="nofollow noreferrer">https://developercommunity.visualstudio.com/content/problem/676342/how-to-use-output-variable-from-a-powershell-scrip.html</a></p>
  <p>Can anyone help me on this ..?</p>
  <p>Thanks in advance.</p>