0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Set-ExecutionPolicy コマンドレットの主なオプション

Last updated at Posted at 2019-09-16

詳しくは公式ドキュメントを参照。

実行ポリシーの指定

-ExecutionPolicy <実行ポリシー>

設定可能な値は以下の通り。

  • AllSigned: 署名付きのスクリプトのみ実行。
  • Bypass: すべてのスクリプトを確認なしで実行。
  • Default: クライアント OS では Restricted と同じ。サーバー OS では RemoteSigned と同じ。
  • RemoteSigned: ローカルにあるスクリプトを実行。インターネットから取得したスクリプトの実行には署名が必要。
  • Restricted: スクリプトを実行しない。
  • Undefined: 実行ポリシーを設定しない。すべてのスコープで Undefined であれば Restricted と同じ。
  • Unrestricted: ローカルにあるスクリプトは確認なしで実行。インターネットから取得したスクリプトの実行には確認が必要。非 Windows 環境では常にこの値。

スコープの指定

-Scope <スコープ>

設定可能な値は以下の通り。

  • CurrentUser: 現在のユーザー。
  • LocalMachine: すべてのユーザー。
  • Process: 現在の PowerShell セッションのみ。

省略した場合は LocalMachine

LocalMachine の実行ポリシーを変更するには PowerShell を管理者として実行する必要がある。

確認せずに設定

-Force
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?