0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

PowerShellの実行ポリシーによるエラーと解決策

0
Posted at

はじめに

初投稿やってみました。
業務中、Powershellでコマンドを実行したらエラーになったので、調べた内容をまとめます。

問題

Powershellで以下のコマンドを実行したらエラーになりました。

実行コマンド

Invoke-Expression (poetry env activate)

エラー文

+ CategoryInfo          : セキュリティ エラー: (: ) []、PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess

原因

Powershellの実行ポリシーが原因でした。
実行ポリシーを更新し、無事解決できました。
以下に現在の実行ポリシーの確認コマンドと更新コマンドを記載します。

確認コマンド

Get-ExecutionPolicy

実行結果(例)

Restricted

更新コマンド

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

おわりに

軽く調べた内容をローカルにメモしていましたが、それだと身に付いた感じがしなかったので記事に書いてアウトプットしてみました。
言語化していくとよくわからない概念や用語に出くわし、自信のない状態で記事を書き起こすことに不安を感じましたが、行動した時点でプラスと捉えようと思います:thumbsup:

参考資料

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?