You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows "previous versions" now opens pwsh.exe not explorer #6799
pwsh.exe at path PS V:\@GMT-2018.04.23-10.11.03\ (of the time opened)
Work Around
I can just type start . to get explorer
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.1.0-preview.2
PSEdition Core
GitCommitId v6.1.0-preview.2
OS Microsoft Windows 10.0.16299
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
On Windows 10 1803, when I click open on one of the previous versions of a library folder, then nothing happens at all, no matter if I have installed preview2, the latest preview or uninstall pwsh completely (but it works when opening e.g. a text file inside one of those folders)...
This should not be related to the optional context menu that was added in 6.1 but it would be good to know whether the behaviour is different on your machine if you have have the explorer context menu option in the PowerShell installer enabled or not. I rather suspect some other program has changed your system. Does this behaviour stop happening if you uninstall the preview and install 6.0.2 instead Jack (@Jackbennett) ?
Otherwise, just for the record: After 6.0.2, MSFT did some compliance refactoring of the installer but I was not involved in that.
Sorry it's been a while but on the up side this is completely re-imaged with MDT 1709 windows 10 x64 which was a fresh build from a microsoft ISO install from the initial report.
Steps to reproduce
Find a folder with previous versions
Select "open" on an older folder version
You will see explorer open at that point in time.
Install PowerShell-6.1.0-win-x64.msi
Click open again, You now get pwsh.exe at the previous version file path
> $PsversionTable
Name Value
---- -----
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Microsoft Windows 10.0.16299
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Jack (@Jackbennett) Thanks for the detailed report. I suspect this might be related to #7815 that I started to investigate yesterday. I hope to have an answer in the next days. For the moment the recommendation is to re-install PowerShell without the context menu option if this is a blocking problem.
Thanks for confirming this (as it proves the problem is caused by this feature). I will investigate but there is a chance that this might even be a bug in Windows
Ji Luo (@GeeLaw) Where did you see that we assume the default verb for folders?
I checked all the registry keys and could boil it down to the HKCR\Directory\shell\PowerShell6x64 entry and HKCR\Directory\ContextMenus\PowerShell6x64\shell\open, which is necessary for non-admin sub menu context menu.
Christoph Bergmeister (@bergmeister) Sorry, it isn't because PS6 assumes the default verb, it is because it takes the open verb -- the cascaded menu verb is named as open. If SEE_MASK_INVOKEIDLIST is used, this verb will be found by ShellExecuteEx, which is the case for "Open" in "Previous Versions".
If you rename HKCR\Directory\ContextMenus\PowerShell6x64\shell\open to openpwsh, the problem will go away.
Ordinarily, the open verb is found in HKLM\SOFTWARE\Classes\Folder\shell\open. PowerShell's context menu overrides this because it is found later than the should-be open.
I'm writing a blog entry for a detailed analysis on this issue. Will be modifying this comment to reflect the entry later. Updated:here it is.
It is also worth mentioning that currently the installer does not install on a per-user basis. The cascaded context menu will always be created for all users. As a piece of advice, the installer should be more specific on whether to install the keys to HKCU\Software\Classes or HKLM\SOFTWARE\Classes. Even if the installer is running as administrator, the value still might be written to HKCU\Software\Classes, if the key already exists in HKCU.
Ji Luo (@GeeLaw) Thanks for the detailed answer, I opened a pull request with a fix for the open verb to use openpwsh but I don't think we should change runas to runaspwsh due to the required elevation (and having a flickering launcher instead is not preferred instead, I proposed this already when I originally did the feature) because as far as I can see, continuing to use the default verb for runas should not cause a problem or is probably an edge case to be disregarded.
Has there been a regression of this? I just installed the latest Powershell Core MSI (PowerShell-6.1.3-win-x64) and it's opening the previous version of a folder in a powershell window. Uninstalling PowerShell core reverts the behavior back to normal.
Or has something changed and this is the intended behavior now?
Jose A Hernandez (@JHBoricua) The fix was in https://github.com/PowerShell/PowerShell/pull/7932/files You can just check your registry entries. The fix was made after 6.1 was released, therefore it is very unlikely, the commit was included in one of the patches (which are mostly just for security critical patching of the runtime, etc.). Please try 6.2-rc
This problem is back in PowerShell 7 v7.3.7, the registry is correctly what it is supoosed to be but sill previous versions are opening in pwsh.exe when clicking the open button, however when double-clicking the folder itself, the previous version opens in File Explorer
Activity
GeeLaw commentedon May 2, 2018
Did you mean installing the preview PowerShell somehow makes File Explorer think
pwsh.exeis the shell program (which is usuallyexplorer.exe)?Jackbennett commentedon May 2, 2018
iSazonov commentedon May 3, 2018
/cc Christoph Bergmeister (@bergmeister) Could you please comment?
bergmeister commentedon May 3, 2018
On Windows 10 1803, when I click open on one of the previous versions of a library folder, then nothing happens at all, no matter if I have installed preview2, the latest preview or uninstall pwsh completely (but it works when opening e.g. a text file inside one of those folders)...
This should not be related to the optional context menu that was added in 6.1 but it would be good to know whether the behaviour is different on your machine if you have have the explorer context menu option in the PowerShell installer enabled or not. I rather suspect some other program has changed your system. Does this behaviour stop happening if you uninstall the preview and install 6.0.2 instead Jack (@Jackbennett) ?
Otherwise, just for the record: After 6.0.2, MSFT did some compliance refactoring of the installer but I was not involved in that.
bergmeister commentedon Oct 1, 2018
Jack (@Jackbennett) Does this still happen with
6.1.0in your environment?Jackbennett commentedon Oct 2, 2018
I'm afraid to report the same issue
Sorry it's been a while but on the up side this is completely re-imaged with MDT 1709 windows 10 x64 which was a fresh build from a microsoft ISO install from the initial report.
Steps to reproduce
PowerShell-6.1.0-win-x64.msiWinver:

bergmeister commentedon Oct 2, 2018
Jack (@Jackbennett) Thanks for the detailed report. I suspect this might be related to #7815 that I started to investigate yesterday. I hope to have an answer in the next days. For the moment the recommendation is to re-install PowerShell without the context menu option if this is a blocking problem.
Jackbennett commentedon Oct 2, 2018
For completeness removed/installed without the context option ticked does indeed fix the issue. Interesting coincidence.
bergmeister commentedon Oct 2, 2018
Thanks for confirming this (as it proves the problem is caused by this feature). I will investigate but there is a chance that this might even be a bug in Windows
GeeLaw commentedon Oct 2, 2018
Perhaps it is because PowerShell context menu assumed the default verb for folders?
bergmeister commentedon Oct 2, 2018
Ji Luo (@GeeLaw) Where did you see that we assume the default verb for folders?
I checked all the registry keys and could boil it down to the HKCR\Directory\shell\PowerShell6x64 entry and HKCR\Directory\ContextMenus\PowerShell6x64\shell\open, which is necessary for non-admin sub menu context menu.
GeeLaw commentedon Oct 2, 2018
Christoph Bergmeister (@bergmeister) Sorry, it isn't because PS6 assumes the default verb, it is because it takes the
openverb -- the cascaded menu verb is named asopen. IfSEE_MASK_INVOKEIDLISTis used, this verb will be found byShellExecuteEx, which is the case for "Open" in "Previous Versions".If you rename
HKCR\Directory\ContextMenus\PowerShell6x64\shell\opentoopenpwsh, the problem will go away.Ordinarily, the
openverb is found inHKLM\SOFTWARE\Classes\Folder\shell\open. PowerShell's context menu overrides this because it is found later than the should-beopen.I'm writing a blog entry for a detailed analysis on this issue. Will be modifying this comment to reflect the entry later. Updated: here it is.
It is also worth mentioning that currently the installer does not install on a per-user basis. The cascaded context menu will always be created for all users. As a piece of advice, the installer should be more specific on whether to install the keys to
HKCU\Software\ClassesorHKLM\SOFTWARE\Classes. Even if the installer is running as administrator, the value still might be written toHKCU\Software\Classes, if the key already exists inHKCU.bergmeister commentedon Oct 3, 2018
Ji Luo (@GeeLaw) Thanks for the detailed answer, I opened a pull request with a fix for the
openverb to useopenpwshbut I don't think we should changerunastorunaspwshdue to the required elevation (and having a flickering launcher instead is not preferred instead, I proposed this already when I originally did the feature) because as far as I can see, continuing to use the default verb forrunasshould not cause a problem or is probably an edge case to be disregarded.JHBoricua commentedon Mar 7, 2019
Has there been a regression of this? I just installed the latest Powershell Core MSI (PowerShell-6.1.3-win-x64) and it's opening the previous version of a folder in a powershell window. Uninstalling PowerShell core reverts the behavior back to normal.
Or has something changed and this is the intended behavior now?
bergmeister commentedon Mar 7, 2019
Jose A Hernandez (@JHBoricua) The fix was in https://github.com/PowerShell/PowerShell/pull/7932/files You can just check your registry entries. The fix was made after 6.1 was released, therefore it is very unlikely, the commit was included in one of the patches (which are mostly just for security critical patching of the runtime, etc.). Please try 6.2-rc
kryptowastaken commentedon Jan 11, 2024
This problem is back in PowerShell 7 v7.3.7, the registry is correctly what it is supoosed to be but sill previous versions are opening in pwsh.exe when clicking the open button, however when double-clicking the folder itself, the previous version opens in File Explorer
