title: How to update Env vars from jenkins Powershell script
body: <p><strong>Hello Trying to update jenkins Env variables from Powershell script written in stage</strong></p>
  <pre><code>pipeline {
      agent { label 'master' }
      environment {
          def var1    = &quot;default_value&quot;
          def var2    = &quot;default var 2&quot;
      }
      stages {
          stage ('step-1') {
              steps {
                  script { 
                      powershell (returnStdout: true, script: '''
                          ${env:var1} = &quot;changed from powershell&quot;
                          ${env:var2} = &quot;var2 changed from powershell&quot;
                      ''').trim()
                  }
              }
          }
          stage (&quot;step-2&quot;){
              steps {
                  echo var1
                  echo var2
              }
          }
      }
  }
  </code></pre>
  <p>I can access values but cannot change the same, Does Scope is limited to Powershell only?</p>