我可以newman
毫无问题地从常规 powershell 执行命令:
但是,当我让 Jenkins 运行相同的脚本时,我得到以下输出:
Checkinig prerequisites
Chocolatey is already installed
NodeJS is already installed
NPM is already installed
Starting collection tests
Testing C:\Program Files (x86)\Jenkins\workspace\GenericServiceWithPostman\Collections\Account Recv Microservice.postman_collection.json
newman : The term 'newman' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At C:\Program Files
(x86)\Jenkins\workspace\GenericServiceWithPostman\RunColletionTests.ps1:47
char:1
+ newman run $test.FullName --environment .\Environments\DEV01.postman_ ...
+ ~~~~~~
+ CategoryInfo : ObjectNotFound: (newman:String) [], CommandNotFo
undException
+ FullyQualifiedErrorId : CommandNotFoundException
我运行的脚本:
$tests = gci .\Collections\*postman_collection.json| Select-Object -Property FullName
foreach ($test in $tests)
{
Write-Host ""
Write-Host " Testing " $test.FullName
Start-Sleep -s 5
newman run $test.FullName --environment .\Environments\DEV01.postman_environment.json
}
术语“newman”未被识别为 cmdlet 的名称
我究竟做错了什么?我如何让它看到newman
?