title: Jenkins Pipeline - Set process.env variable from build parameter
body: <p>In my Jenkins feature file I have set a build parameter using:</p>
  
  <pre><code>  parameters {
          string(defaultValue: "http://xxx.xxx.xxx.xxx:1xxx/",
                description: 'Which environment to run on',
                name: 'Environment')
      }
  </code></pre>
  
  <p>Initially, I attempted to use the <code>environment</code> block to set this as a <code>process.env</code> variable however realised that I can't access it using the standard <code>${params.Environment}</code>.</p>
  
  <p>So i found it can be accessed in the steps/script block however how do I set it a process.env variable so that my code can see it:</p>
  
  <pre><code>steps {
          script {
            //def process.env.MYENVTEST = "${params.Environment}"
            ...
          }
        }
  </code></pre>