UJP - 技術情報2 バックアップ : PowerShell/01/Get-ExecutionPolicy の変更点

Life is fun and easy!

不正IP報告数

Okan Sensor
 
メイン
ログイン
ブログ カテゴリ一覧

  
現: 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

トップ   編集 差分 バックアップ 添付 複製 名前変更 リロード   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom
Counter: 1160, today: 1, yesterday: 1

広告スペース
Google