从 Jenkins 管道中的文件运行 Powershell 脚本 [英] Run Powershell script from file in Jenkins pipeline

查看:28
本文介绍了从 Jenkins 管道中的文件运行 Powershell 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从 Jenkins 管道中的文件运行 Powershell 脚本.

I am trying to run a Powershell script from a file in a Jenkins pipeline.

我已阅读 this,其中展示了如何运行 powershell 脚本已输入管道,但我无法从文件中运行脚本.

I have read this which shows how to run powershell scripts that are entered into the pipeline, but I can't get a script to run from a file.

我试过了:

powershell returnStatus: true, script: '-File build.ps1'

以及各种组合,但不知道如何做到这一点.

and various combinations but can't figure out how to do this.

推荐答案

很快就想通了,那行应该是这样写的

Figured it out soon after, the line should have read

powershell returnStatus: true, script: '.\build.ps1'

这篇关于从 Jenkins 管道中的文件运行 Powershell 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆