- ソース を表示
- PowerShell/01/Get-ExecutionPolicy へ行く。
| 現: 2019-12-19 (木) 00:45:22 nobuaki |
|||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | *PowerShellの実行ポリシー [#ib27838a] | ||
| + | **はじめに [#vaab2da7] | ||
| + | |||
| + | PowerShellを使ってみようとして,いきなり動かない.PowerShellは強力な機能が故に,セキュリティホールになるから,デフォルトでは実行できないように設定してある. | ||
| + | このドキュメントでは,実行ポリシー(Execution Policy)を確認して,変更する手順を示す. | ||
| + | |||
| + | **実行ポリシーの現在設定を確認 [#jeea0b02] | ||
| + | |||
| + | コマンドプロンプトから,PowerShellを実行して,Get-ExecutionPolicyコマンドレットを実行させて,現在設定を確認する. | ||
| + | |||
| + | #ref(site://modules/xelfinder/index.php?page=view&file=6558&PowerShellExecutionPolicy1.jpg,center) | ||
| + | restrictedとレスポンスがあったので,制限された状態. | ||
| + | |||
| + | PowerShellの開発環境,PowerShell ISEを使ってコマンドレットを実行. | ||
| + | |||
| + | #ref(site://modules/xelfinder/index.php?page=view&file=6559&PowerShellExecutionPolicy2.jpg,center,mw:600,mh:600) | ||
| + | |||
| + | すると,エラーが. | ||
| + | |||
| + | このシステムではスクリプトの実行が無効になっているため、 | ||
| + | ファイル C:\Users\ujpadmin\Desktop\getPolicy.ps1 を | ||
| + | 読み込むことができません。 | ||
| + | 詳細については、「about_Execution_Policies」 | ||
| + | (https://go.microsoft.com/fwlink/?LinkID=135170) を参照してください。」 | ||
| + | |||
| + | 実行ポリシーの変更が必要. | ||
| + | |||
| + | **実行ポリシーをUnrestrictedにする [#zdcd1b86] | ||
| + | |||
| + | 実行ポリシーには,restricted,AllSigned,RemoteSigned,Unrestrictedと制限が強い順に設定できるが,ここでは一番弱いUnrestrictedに変更する. | ||
| + | |||
| + | #ref(site://modules/xelfinder/index.php?page=view&file=6560&PowerShellExecutionPolicy3.jpg,center) | ||
| + | 管理者権限がなかったのでエラーになった. | ||
| + | |||
| + | #ref(site://modules/xelfinder/index.php?page=view&file=6554&PowerShellExecutionPolicy4.jpg,center) | ||
| + | スタートメニューを右クリックして,PowerShellを管理者モードで開く. | ||
| + | |||
| + | #ref(site://modules/xelfinder/index.php?page=view&file=6556&PowerShellExecutionPolicy5.jpg,center,mw:600,mh:600) | ||
| + | Set-ExecutionPolicyにて,unrestrictedを設定できた. | ||
- PowerShell/01/Get-ExecutionPolicy のバックアップ差分(No. All)
- 現: 2019-12-19 (木) 00:45:22 nobuaki
Counter: 1539,
today: 1,
yesterday: 1

