Можно ли вызвать сценарий Powershell с путем к сценарию на узле, не являющемся основным? У меня есть код, но он выдает ошибку, хотя скрипт выполняется отдельно не от задания
pipeline {
agent none
options {
skipDefaultCheckout true
}
environment {
PATH = "C:\\Windows\\System32"
}
parameters {
string(name: 'Machine', defaultValue: 'Server', description: '')
}
stages{
stage('create new machine') {
agent { label "$params.Machine" }
steps {
script {
powershellCmd("C:\\Users\\Administrator\\Desktop\\CreateQAXml.ps1")
}
}
}
}
}
C:\Jenkins\workspace\Run Test>powershell.exe -NonInteractive -ExecutionPolicy Bypass -Command "[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;C:\Users\Administrator\Desktop\CreateQAXml.ps1;EXIT $global:LastExitCode"
'powershell.exe' is not recognized as an internal or external command,
operable program or batch file.