Windows PowerShell にある未署名のスクリプト
プラットフォームの注記: Cloud のみ - This article only applies to Atlassian apps on the クラウド プラットフォーム上のアトラシアン製品にのみ適用されます。
要約
A Windows-based runner has failed to run one or more steps due to an unsigned PowerShell (.ps1) script
診断
Windows ベースのランナーが未署名の PowerShell (.ps1) スクリプトが原因で 1 つ以上のステップを実行できず、次のようなエラーが発生しました。
.\start.ps1 : File C:\Users\Administrator\atlassian-bitbucket-pipelines-runner\bin\start.ps1 cannot be loaded. The file
C:\Users\Administrator\atlassian-bitbucket-pipelines-runner\bin\start.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
https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\start.ps1 -accountUuid '{924bbdf1-ea18-2c70-4655-2bb23075ddbf}' -re ...
+ ~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess原因
Windows ランナーは、リポジトリをクローンしてパイプラインの各stepでscriptを実行するための PowerShell スクリプトを生成します。これらのスクリプトはパイプラインの実行時に生成されて、デジタル署名されません。
To allow the Windows runners to run unsigned PowerShell scripts, set the PowerShell execution policy of the CurrentUser to either:
RemoteSigned(recommended)unrestrictedbypass
The RemoteSigned execution policy allows local unsigned (uncertified) scripts to run on the device. This includes any potentially malicious unsigned scripts. Before changing the execution policy, review the execution policies and consider their security implications at Microsoft Docs — PowerShell execution policies.
ソリューション
CurrentUser の実行ポリシーを確認するには、次の手順に従います。
Windows の [スタート] メニューから Windows PowerShell を開きます。
次のコマンドを実行すると、
CurrentUserの実行ポリシーが返されます。Get-ExecutionPolicy -Scope CurrentUser
CurrentUser の実行ポリシーを RemoteSigned に変更するには、次の手順に従います。
Windows PowerShell で、次のコマンドを実行します。
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUserGet-ExecutionPolicyを実行して正常に変更されたことを検証し、CurrentUserにRemoteSigned実行ポリシーがあることを確認します。Get-ExecutionPolicy -Scope CurrentUser
For information on Microsoft PowerShell execution policies, visit Microsoft Docs — PowerShell: about Execution Policies.
この内容はお役に立ちましたか?