title: How to pass a parameter to a powershell script in a jenkins pipeline
body: <p>How do I pass my variable VAR_A to an embedded powershell script in a jenkins pipeline ?</p>
  
  <p>e.g. </p>
  
  <pre><code>def VAR_A = 'test'
  def mystatus = powershell(returnStatus: true, script: '''
                  Write-Host "My result: '$VAR_A'" '''
  
  
  withEnv(["VAR_A=test"]) {
  def mystatus = powershell(returnStatus: true, script: '''
                  Write-Host "My result: '$VAR_A'" '''
  }
  </code></pre>
  
  <p>both result with following output
  My result: ''</p>
  
  <p>Note : I prefer to define my powershell script in the jenkinsfile to keep things simple.</p>