Недавно я переключил службу Jenkins (Windows) на функциональную учетную запись, вместо того чтобы позволить Jenkins работать как Local System Account
. Однако теперь скрипт не запускается и выдает ошибку
powershell.exe : & : File D:\jenkins\tools\ci-home\workspace\im-server_feature_os-jenkins-aaw@tmp\durable-42a4a855\powershellScript.ps1
At D:\jenkins\tools\ci-home\workspace\im-server_feature_os-jenkins-aaw@tmp\durable-42a4a855\powershellWrapper.ps1:3 char:1
+ & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (& : File D:\jen...hellScript.ps1 :String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
cannot be loaded. The file
D:\jenkins\tools\ci-home\workspace\im-server_feature_os-jenkins-aaw@tmp\durable-42a4a855\powershellScript.ps1 is not
digitally signed. You cannot run this script on the current system. For more information about running scripts and
setting execution policy, see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:3
+ & 'd:\jenkins\tools\ci-home\workspace\im-server_feature_os-jenkins-aa ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
. Точный вызов выглядит следующим образом:
command = '.\\build.ps1 -Project "IM-Server"'
log = powershell returnStdout: true, script: command
Удаленная политика для пользователя - RemoteSigned
- что должно быть хорошо поскольку сценарий в любом случае написан локально.
Что еще интереснее, сам Дженкинс вызывает сценарий с помощью -ExecutionPolicy Bypass
.
powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm...
Что я пропускаю?