Я могу без проблем выполнять команды newman
из обычного powershell:
Однако, когда Дженкинс запускает тот же скрипт, я получаю следующий вывод:
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" не распознается как имя командлета
Что я делаю не так? Как заставить его видеть newman
?