4

I currently have both installed in Windows 10, and have no problem opening either from the start menu. They can be used side-by-side.

However, I have need trick that when in a folder in Windows Explorer, if I hit Alt+F, the menu that pops up including a choice to Open Windows PowerShell. That menu item has twp hotkeys, R and S, and hitting S split the menu item into 2: one to open PowerShell in Admin mode and one to open it with normal privilege.

So to open a PowerShell console, in admin mode, from a folder in Explorer, I just hit Alt+F,S,A, and bang, Powershell 5 opens.

I would like to know if and how I can trick this menu or hotkey combo to open PowerShell 6 instead.

2
  • 1
    Did you consider adding a new context menu entry for PowerShell 6?
    – Seth
    Jan 27, 2018 at 9:39
  • 1
    @Seth That is basically what my question is, but I would rather like to add to the context menu that appears when I hit Alt+F, not when I right click in the folder.
    – ProfK
    Jan 30, 2018 at 5:58

1 Answer 1

1

That is a lot of work, to just run PoSH as an Admin. Just set you PoSH shortcuts to Run As Admin via the shortcut properties, in the Advanced section.

Copy and paste those shortcuts wherever is prudent for you. Taskbar, Desktop, SendTo Menu.

Use the registry to set pwsh.exe as the Right Click Explorer Context Menu option.

Add PowerShell to Windows Explorer Context Menu in Windows 10 https://www.petri.com/add-powershell-windows-explorer-context-menu-windows-10

You do know you can start PoSH in any folder from explorer, simply by clicking the folder the tap F4 and just type powershell or pwsh, or cmd, and they will start from the selected folder. No RegHacks required or other key binding creation and you include in your profile code to auto elevate you to admin.

2
  • F4 is an acceptable alternative, but I don't want this to just run PoSH as admin. I want it to open PoSH in the folder I am working in, where at the moment I have to open PoSH, copy the path from the Explorer window, and CD to that folder in PoSH.
    – ProfK
    Jan 30, 2018 at 5:52
  • F4 is not a PoSH runs as admin thing. It won't do that by default. All that does is put you in the Explorer navigation bar to type whatever you wish. As for open PoSH in the folder you are working in, the F4 option does that. There is no need to copy a folder path or cd to anything. Select the folder, hit F4, erase whatever is there /or click in the navigation bar and type powershell, pwsh, cmd and the console will open in the folder you clicked on prior to typing stuff in the navigation. I do this all the time. Not once have I ever copied/cd to anything. Select, click, type, enter, that's all
    – postanote
    Jan 30, 2018 at 6:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .