I have implemented it similar to cmd
.
Also, I adapted existing Windows Registry keys for the built-in Powershell 5.1 instead of creating new registry entries from scratch.
Step 0
Step 1
Take ownership on the KEY_CLASSES_ROOT\Directory\Background\shell\Powershell
branch of Windows Registry.
It is needed to be able to edit the registry entries mentioned below.
Step 2
Delete the «ShowBasedOnVelocityId» key from the HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell
branch of Windows Registry:
askvg.com/windows-10-tip-restore-open-command-window-here-option-in-shiftright-click-menu
Step 3
Step 4
Replace the Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Powershell\command
key's value from
powershell.exe -noexit -command Set-Location -literalPath '%V'
to
pwsh -noexit -command Set-Location -literalPath '%V'
-
powershell.exe
is PowerShell 5.1 -
pwsh
is PowerShell 7 (it is located at%ProgramFiles%\PowerShell\7\pwsh.exe
)
Step 5
Add the «Icon» key (similar to cmd
):
Step 6
Rename «Open PowerShell window here» to «PowerShell» (similar to cmd
):