Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的jenkins项目有一个参数化的构建。我正在尝试将字符串参数作为 .bat 脚本传递给***.ps1 -param1=$param1.
jenkins
***.ps1 -param1=$param1
您应该能够使用%param1%. 环境变量应该已经可以通过您的 bat 脚本环境访问(例如,如果您将其作为构建步骤运行,则不必将它们传递给 bat 脚本)。但是,如果您尝试在命令行上传递参数,您应该能够像这样访问参数:${param1}.
%param1%
${param1}