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
  • 135,435
  • 9
  • 130
  • 184

0 Answers0