自作の .PS1 ファイルを実行できるようにする

PowerShellスクリプトの実行ポリシー」を下記の手順で変更すればおk:
  1. コマンドプロンプト」を、右クリックメニューの「管理者として実行」で開く。
  2. コマンドプロンプト」が起動したら、"powershell" と入力して PowerShell を起動する。
  3. PowerShell が起動したら、"Set-ExecutionPolicy RemoteSigned" と入力する。
C:\windows\system32>powershell
Windows PowerShell
Copyright (C) 2015 Microsoft Corporation. All rights reserved.

PS C:\windows\system32> Set-ExecutionPolicy RemoteSigned
  • なお、 現在の「PowerShellスクリプトの実行ポリシー」の設定状況は、"Get-ExecutionPolicy" より確認することができる:
PS C:\Users\cigi> Get-ExecutionPolicy
RemoteSigned