1

For example, there is a Jenkins stage with defined variable - jenkinsVariable = 5 How can I access that variable in the powershell block? Is that possible like this or I need to call powershell.ps1 with parameters in order to transfer variable from jenkins to powershell area?

stage (testStage)
{
  def jenkinsVariable = 5;
  def result = powershell (returnStdout: true, script: 'Write-Output jenkinsVariable')
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.