且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将变量传递给jenkins管道中的powershell脚本块

更新时间:2023-01-08 18:58:10

您不能在单引号或三重单引号中插入变量.使用三重双引号:

You can't interpolate variables in single quotes or triple-single-quotes. Use triple-double-quotes:

  stdoutpowershell = powershell returnStdout: true, script: """
      write-output "Server is $envserverName"
  """