Add Open PowerShell To Context Menu

I am sure most of us prefer to use the quick menu that appears when we right click on any Windows object. Let’s have a look on the menu we get when we press shift +right click on a folder in Windows 7 or Windows Server 2008:

Add PowerShell to Context Menu

As you see above, by default, there is an option called “Open command window here”.
Wouldn’t it be nice to have “Open PowerShell here” also? Now we are going to do it!

Warning:

This document contains instructions for editing the registry. If you make any error while editing the registry, you can potentially cause Windows to fail or be unable to boot, requiring you to reinstall Windows. Edit the registry at your own risk. Always back up the registry before making any changes. If you do not feel comfortable editing the registry, do not attempt these instructions. Instead, seek the help of a trained computer specialist.

Edit Registry

Let’s Begin:

  1. Press Start button + R to open run command dialog box. Type regedit and press Enter to open the Registry Editor. You may be prompted with a UAC prompt, click “Yes”.
    Edit Registry
  2. Navigate to the following path:
    HKEY_CLASSES_ROOTDirectoryShellAdd PowerShell to Context Menu
  3. Right click on the right pane and select New > Key.
    Add PowerShell to Context Menu
  4. Enter the values:  powershell.
    Add PowerShell to Context Menu
  5. On the right pane, double click on Default and set the value to Open PowerShell Here. Click OK.
    Add PowerShell to Context Menu
  6. On the left pane mark powershell and right click on the right pane and select New > Key.
    Add PowerShell to Context Menu
  7. Enter the value: command.
    Add PowerShell to Context Menu
  8. On the right pane, double click on Default and set the value to (just copy-paste it):
    C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command Set-Location -LiteralPath ‘%L’
    Click OK.
    Add PowerShell to Context Menu
  9. After you followed the above steps, your scope of registry has to look like that:
    Add PowerShell to Context Menu

Conclusion

That’s it! Now when you shift+right click on any folder on your computer the menu will look like that:

Add PowerShell to Context Menu

Hope it makes you life easier.

FAQs

How can I add PowerShell to the Context Menu without editing the registry directly?

You can add PowerShell to the Context Menu using PowerShell Script Editor or third-party tools like ShellMenuView and ShellMenuNew, which provide a safer alternative to direct registry editing. These tools offer user-friendly interfaces to modify context menu entries.

Will adding PowerShell to the Context Menu affect system performance?

Adding PowerShell to the Context Menu has minimal impact on system performance, typically consuming less than 1MB of memory when not in use. The context menu integration is lightweight and only loads PowerShell resources when specifically accessed.

Can I add PowerShell to the Context Menu on Windows 11?

Yes, the process to add PowerShell to the Context Menu works on Windows 11, though the interface might slightly differ. Windows 11 users can also access PowerShell through the modernized context menu by clicking “Show more options” or pressing Shift+F10.

What happens if I need to remove PowerShell from the Context Menu?

To remove PowerShell from the Context Menu, you can either delete the registry entries you created or use system restore to revert changes. Alternatively, you can temporarily disable the context menu entry by adding a “Disabled” DWORD value to the registry key.

Does adding PowerShell to the Context Menu require admin privileges?

Yes, you need administrator privileges to add PowerShell to the Context Menu since it involves modifying system registry entries. Running registry editor or third-party context menu tools requires elevation through User Account Control (UAC).