title: Bad substitution when passing parameter to shell script in Jenkinsfile
body: <p>In a Jenkinsfile I'm attempting to set an environment variable by setting the stdOut of a shell script. The script contains an AWS command that returns an InstanceID:</p>
  <pre><code>stage('Set InstanceID') {
           steps {
               script {
             env.IID = sh (script: 'scripts/get-node-id.sh &quot;${params.ENVIRONMENT}&quot; &quot;${params.NODE}&quot;', returnStdout: true).trim()
               }
            }
      }
  </code></pre>
  <p>No matter what I do or how many backslashes I use to escape the quotes, nothing works. I get a bad substitution error. I've also tried without double quotes.</p>
  <p>If I hardcode in the shell script arguments, it runs fine.</p>
  <p>How do I get this working if I want to use the parameter values here?</p>