powershell - 需要使用 Groovy 在 SoapUI 中调用 PowerShell 文件
问题描述
我需要使用 Groovy 脚本在 SoapUI 中调用 PowerShell 文件。
这是我尝试过的(不起作用):
def testprojectDir = context.expand('${projectDir}')
def fileName = "test.ps"
def file1 = new File(testprojectDir + '/Testdata///' + fileName );
def powerShellCommand = file1
def shellCommand = "powershell.exe -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -Command \"${powerShellCommand}\""
def process = shellCommand.execute()
process.waitFor()
“test.ps”中的PowerShell代码如下:“Some text...” | Out-File C:\temp\filename1.txt -encoding ascii
有什么建议可以让 Groovy 与 PowerShell 一起工作吗?
解决方案
推荐阅读
- oracle - 为什么在并行语句中忽略 dml 错误日志记录
- html - Bootstrap Card 影响 iOS 上固定正文背景图像的大小
- android - 无法将 java.lang.String 类型的对象转换为 com.example.home.Model.Order1 类型
- r - 如何使用 pmap 进行非标准评估?
- c# - 带有自定义 JWT 身份验证的 OAuth
- csv - 是否有一个 Mathematica 函数可以导入 500 多个 CSV 文件并合并到一个列表中?
- powerbi - 测量不过滤 lastdate
- azure-api-management - 为什么 Set-Body 策略无法识别我的 POST 正文?
- python - 如何对目录中的每个文件重复相同的操作?
- vb.net - 对于 WCF - 如何在仍在处理的同时返回客户端