An option to hide the 2 "Windows PowerShell" items in the WinX menu on Windows 10 and replace them with "PowerShell Core".
I want the WinX menu to launch powershell core instead of Windows PowerShell.
I would rather prefer if the installed added items for PowerShell Core instead because an installer should not modify components such as Windows PowerShell that are deeply embedded into the OS. cc @SteveL-MSFT
At the very least the option to hide the existing entries should (eventually) be presented.
But if that becomes a thing, there should be a way to revert back or add back the windows PowerShell entries. Perhaps there could also be a cmdlet added for this purpose?
Since PowerShell Core currently exists outside of Windows, we should not be making any changes to Windows itself that affects Windows PowerShell (although I do love seeing the interest/passion for this). At some point (hopefully sooner than later), we'll have sufficient usage and compatibility that we can formally start considering having PowerShell Core inbox.
Steve,
Changing the Win-X menu does not modify powershell. For the most part, it's registry entries that point to a bunch of shortcut links. Changing the shortcuts links on the file system updates the menu.
Windows Powershell itself affected. This is just adding (and optionally hiding the Windows Powershell shortcuts) in the WinX menu.
This is similar to the option of replacing the command prompt shortcuts in the WinX menu with Powershell. I don't understand your concern Steve when Windows already allows this option.
@robertbaker I realize that the settings are stored in the registry, but are those registry settings documented? The problem with making system level changes like this is when a customer calls Customer Support and they ask the customer to Win-X PowerShell, it will do something different than what Support expects (as an example). If we can add PSCore to the menu, I'd certainly be open to that rather than replacing.
Steve,
The WinX menu is per user. The shortcuts are in %localappdata%, I was incorrect previously, however this is great news.
I would prefer both options to be available, I really want to replace it. can. Windows PowerShell is deprecated. I personally have no need to keep it in the menu or use Windows PowerShell.
"Replace Windows PowerShell with PowerShell Core"
I'm of those who install PowerShell Core and would use it in place of Windows PowerShell.
At the same time, others may have different needs.
I wouldn't have an issue with adding a checkbox saying "Replace Windows PowerShell Win-X menu with PowerShell Core" and make it opt-in. cc @joeyaiello
If anybody wants to do this for themselves, head to the following directory, possibly via the run menu (Windows + R): %APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell
There, replace the "Windows PowerShell" shortcut with the PowerShell shortcut, renaming it to be the same as the replaced shortcut. The item on the Windows + X menu will still be saying "Windows PowerShell", but will launch PowerShell instead. Admin version also simply works, too.
@SteveL-MSFT Given that you said you want to migrate to MSIX in 6.2, does it mean that items like this should maybe be marked as blocked until later (since the implementation in MSIX is probably different and would make the migration harder)?
@bergmeister I've also heard that MSIX is going to be available downlevel...
In addition to the 'Win + X' menu items, with PowerShell 5.1 *.PS1 files are set to open in Windows Notepad by default. When Notepad is the default application, when right-clicking on a *.PS1 file the right-click menu gives the option to 'Run With PowerShell'. This menu option still opens *.PS1 files in Windows PowerShell 5.1 rather than Powershell 7. Therefore, when considering updating the 'Win + X' menu items to open Powershell 7, the 'Run With PowerShell' right-click menu item should be considered as well.
If anybody wants to do this for themselves, head to the following directory, possibly via the run menu (Windows + R):
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell
There, replace the "Windows PowerShell" shortcut with the PowerShell shortcut, renaming it to be the same as the replaced shortcut. The item on the Windows + X menu will still be saying "Windows PowerShell", but will launch PowerShell instead. Admin version also simply works, too.
Something I had a hard time figuring out is the hidden numerals in the shortcut names.
Most helpful comment
If anybody wants to do this for themselves, head to the following directory, possibly via the run menu (Windows + R):
%APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell
There, replace the "Windows PowerShell" shortcut with the PowerShell shortcut, renaming it to be the same as the replaced shortcut. The item on the Windows + X menu will still be saying "Windows PowerShell", but will launch PowerShell instead. Admin version also simply works, too.