Created
October 15, 2024 14:37
-
-
Save mzhboy/bde094e0048c6de302627df22a82ac49 to your computer and use it in GitHub Desktop.
add `powershell5here` to right menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Directory', | |
'Directory\Background', | |
'Drive' | ForEach-Object { | |
$Path = "Registry::HKEY_CLASSES_ROOT\$_\shell\PowerShell5Here"; | |
New-Item -Path $Path -Name 'command' -Force | Out-Null; | |
Set-ItemProperty -Path "$Path\command" -Name '(default)' -Value "${Env:WinDir}\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -NoLogo -Command ""Set-Location -LiteralPath '%V'"""; | |
Set-ItemProperty -Path $Path -Name '(default)' -Value 'PowerShell5 Here'; | |
Set-ItemProperty -Path $Path -Name 'Icon' -Value "${Env:WinDir}\System32\WindowsPowerShell\v1.0\powershell.exe,0"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\directory\shell\PowerShell5Here] | |
@="PowerShell5 Here" | |
"Icon"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe,0" | |
[HKEY_CLASSES_ROOT\directory\shell\PowerShell5Here\command] | |
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -NoLogo -Command \"Set-Location -LiteralPath '%V'\"" | |
[HKEY_CLASSES_ROOT\directory\background\shell\PowerShell5Here] | |
@="PowerShell5 Here" | |
"Icon"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe,0" | |
[HKEY_CLASSES_ROOT\directory\background\shell\PowerShell5Here\command] | |
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -NoLogo -Command \"Set-Location -LiteralPath '%V'\"" | |
[HKEY_CLASSES_ROOT\Drive\shell\PowerShell5Here] | |
@="PowerShell5 Here" | |
"Icon"="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe,0" | |
[HKEY_CLASSES_ROOT\Drive\shell\PowerShell5Here\command] | |
@="C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit -NoLogo -Command \"Set-Location -LiteralPath '%V'\"" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment