如何使用Groovy脚本测试步骤从ReadyAPI运行Powershell文件.ps1

问题描述

我有一个带参数的Powershell脚本。 运行脚本的命令如下:

.\test.ps1 arg1 arg2 arg3 arg4 arg5 arg6

我的常规脚本代码如下:

def powerShellCommand = '.\\test.ps1 arg1 arg2 arg3 arg4 arg5 arg6'
def shellCommand = "powershell.exe -ExecutionPolicy Bypass -Nologo -NonInteractive -noprofile  -Command \"${powerShellCommand}\""
def process = shellCommand.execute()
process.waitFor()

每当我执行此步骤时,都会出现一个信息框,其中提到Script-result:1并且不运行powershell脚本。 Powershell脚本存储在c:\

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)