Powershellのスクリプトを実行可能にする

環境

作業概要

Powershellの実行ポリシーを変更し、ローカル環境のスクリプト実行を許可する。

作業内容

デフォルト設定の実行ポリシー(Restricted/全てのスクリプトが実行禁止)を確認したのち、ローカル環境のスクリプトは実行できるポリシー(RemoteSigned)ように設定を変更する。

PS C:\Windows\system32> Get-ExecutionPolicy
Restricted

PS C:\Windows\system32> Set-ExecutionPolicy RemoteSigned -Force:$true

PS C:\Windows\system32> Get-ExecutionPolicy
RemoteSigned

参考

+Tech TIPS:WindowsでPowerShellスクリプトの実行セキュリティポリシーを変更する - @IT