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')
}
Mathias R. Jessen
  • 157,619
  • 12
  • 148
  • 206

0 Answers0