Open1

Powershellの新バージョン(7)で.ps1ファイルを実行する方法

Lamron🪽Lamron🪽

.ps1ファイルはショートカットを作り、プロパティの「リンク先」にpowershell -ExecutionPolicy RemoteSigned -File を先頭に付ければ実行可能になります。
しかし、Powershellの新バージョン(7)をインストールしてデフォルトにしている場合は、powershellpwshにする必要があります。つまり、pwsh -ExecutionPolicy RemoteSigned -File を先頭につけます。
https://learn.microsoft.com/ja-jp/powershell/scripting/whats-new/migrating-from-windows-powershell-51-to-powershell-7?view=powershell-7.4