LoginSignup
0
1

More than 3 years have passed since last update.

右クリックメニューで PowerShell 7 を開けるようにする

Last updated at Posted at 2020-11-21

はじめに

Powershellをバージョン7に更新した際、右クリックメニューにある「Powershellで開く」がバージョン5のままだったので。

方法

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\powershell_here]
@="PowerShell"
"Icon"="C:\\Program Files\\PowerShell\\7\\pwsh.exe"

[HKEY_CLASSES_ROOT\Directory\shell\powershell_here\command]
@="C:\\Program Files\\PowerShell\\7\\pwsh.exe -NoExit -Command Set-Location -LiteralPath '%L'"

[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell_here]
@="PowerShell"
"Icon"="C:\\Program Files\\PowerShell\\7\\pwsh.exe"

[HKEY_CLASSES_ROOT\Directory\Background\shell\powershell_here\command]
@="C:\\Program Files\\PowerShell\\7\\pwsh.exe -NoExit -Command Set-Location -LiteralPath '%V'"

これをregファイルとして保存し、結合する。

補足

私は Powershell 7 をインストールする際の設定はデフォルトのままで行ったので、同じくデフォルトの設定で行った方はそのままコピペで大丈夫だと思います。
但し、私の環境は64-bitなので、32-bit版の Powershell を入れた方はファイル名などが恐らく違います。
「pwsh.exe」で検索かけて、自分の Powershell 7 がどこにあるか確認してください。

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