The default "Open with Powershell window here" context menu entries in Win10 that appear when right-clicking a directory or directory background also appear when right-clicking the main library folder as well as specific library folders (documents, music, etc.) in the explorer navigation pane but the shell windows don't work, i.e. you cannot open a powershell window in a library.
Windows by default installs right-click context menu entries to launch a PowerShell window when right clicking a directory or directory background. The entries are installed in HKCU\Directory\shell and HKCU\Directory\Background\Shell. These entries work fine....meaning that when selecting Open PowerShell window upon right-clicking a directory, directory background or drive, a PowerShell window opens up to the desired directory.
However, these context menu entries are also present for Libraries, meaning that Open PowerShell Window Here exists for Libraries, but no shell can be opened for virtual folders and hardlinks. So PowerShell entries are not installed at HKCU\Library\Background\Shell, but, when right clicking the main library icon in File Explorer Navigation Pane, or the background of the main library virtual folder, a PowerShell context menu entry appears. When PowerShell is launched from the entry in a library, nothing happens. Note that, the PowerShell right-click entries for individual libraries, such as documents or pictures, have no PowerShell entries unless added to HKCR\Library\Background\shell
So, I would like to either: modify the context menu commands for PowerShell to open in libraries (which I don't think is possible for virtual folders) or exclude libraries, but not regular folders, from the registry entries.
How do I do this?


