如何在 soapui 中使用 groovy 运行 powershell 命令?
How to run powershell command using groovy in soapui?
我想 运行 在 groovy 中以管理员身份执行以下 powershell 命令..
PS C:\Program Files\APP\Bin> .\app.AdminTool.ps1 -url "https://reference1.jdm-inc.com" enqueue orchestration -file "C:\Program Files\APP\Importer\daily_report.xml" -properties @{ 'processing_date' = '2017-01-17' }
我使用了以下代码来 运行 这个。
String workingDir= System.setProperty("user.dir","C:\Program Files\APP\Bin")
log.info(System.getProperty("user.dir"))
我将以下命令保存在一个变量中。
.\app.AdminTool.ps1 -url "https://reference1.jdm-inc.com" enqueue orchestration -file "C:\Program Files\APP\Importer\daily_report.xml" -properties @{ 'processing_date' = '2017-01-17' }
我尝试了以下命令来更改路径
def proc = "cmd /C dir".execute().text
return proc
这总是带来 soapui bin 文件夹路径..如何更改路径?
def powerShellCommand = '.\app.AdminTool.ps1 -url "https://reference1.jdm-inc.com" enqueue orchestration -file "C:\Program Files\APP\Importer\daily_report.xml" -properties @{ \'processing_date\' = \'2017-01-17\' }'
def shellCommand = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"${powerShellCommand}\""
def process = shellCommand.execute()
process.waitFor()
然后您可以访问 Process.outputStream 以读取命令输出。
我想 运行 在 groovy 中以管理员身份执行以下 powershell 命令..
PS C:\Program Files\APP\Bin> .\app.AdminTool.ps1 -url "https://reference1.jdm-inc.com" enqueue orchestration -file "C:\Program Files\APP\Importer\daily_report.xml" -properties @{ 'processing_date' = '2017-01-17' }
我使用了以下代码来 运行 这个。
String workingDir= System.setProperty("user.dir","C:\Program Files\APP\Bin")
log.info(System.getProperty("user.dir"))
我将以下命令保存在一个变量中。
.\app.AdminTool.ps1 -url "https://reference1.jdm-inc.com" enqueue orchestration -file "C:\Program Files\APP\Importer\daily_report.xml" -properties @{ 'processing_date' = '2017-01-17' }
我尝试了以下命令来更改路径
def proc = "cmd /C dir".execute().text
return proc
这总是带来 soapui bin 文件夹路径..如何更改路径?
def powerShellCommand = '.\app.AdminTool.ps1 -url "https://reference1.jdm-inc.com" enqueue orchestration -file "C:\Program Files\APP\Importer\daily_report.xml" -properties @{ \'processing_date\' = \'2017-01-17\' }'
def shellCommand = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"${powerShellCommand}\""
def process = shellCommand.execute()
process.waitFor()
然后您可以访问 Process.outputStream 以读取命令输出。