Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52799

Powershell not able to get variables when using withCredentials

XMLWordPrintable

      When running a step with credentials and powershell, powershell does not retrieve the variables properly, shows as empty / null.  In the same step, using batch function, the variable shows.

      steps {
      withCredentials([string(credentialsId: 'testvar', variable: 'test')])

      { powershell 'echo "This is a $test"' bat 'echo "This is a %test%"'   }

      }

            Unassigned Unassigned
            tnynyn Tony Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: