Нужно вызвать PowerShell-файл внутри SoapUI с помощью Groovy - PullRequest
0 голосов
/ 22 октября 2019

Мне нужно вызвать файл PowerShell внутри SoapUI с помощью скрипта Groovy.

Вот что я попробовал (это не работает):

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()

Код PowerShell в"test.ps" выглядит следующим образом: "Некоторый текст ..." |Out-File C: \ temp \ filename1.txt -encoding ascii

Есть предложения, как заставить Groovy работать с PowerShell?

...