New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VSCode clobbers "Run with PowerShell" in Windows Explorer context menu #64815
Comments
From @mjbvz on April 20, 2017 22:16 From @rambutan2000 on April 20, 2017 22:12 Looks like others have had a similar problem, looks like its to do with changing the default editor of ps1 files |
From @daviwil on April 20, 2017 22:18 Isn't this caused by VS Code though? The PowerShell extension doesn't mess with default file configurations in Windows. |
From @rambutan2000 on April 20, 2017 22:21 The root cause is some kind of shell bug, but maybe the VS code extension should not automatically associate VS Code with .ps1 files. I've attached a .reg file which fixes the issue. Maybe compare what the extension is doing to register ps1 files with against the reg file contents. I'm adding the contents of the files since this form won't let me attach the file, even though it's zipped :/ Windows Registry Editor Version 5.00 [-HKEY_CLASSES_ROOT.ps1] [HKEY_CLASSES_ROOT.ps1] [-HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\DefaultIcon] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\0] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\0\Command] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Edit\Command] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open] [HKEY_CLASSES_ROOT\Microsoft.PowerShellScript.1\Shell\Open\Command] [-HKEY_CLASSES_ROOTS\SystemFileAssociations.ps1] [-HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts.ps1] |
From @daviwil on April 20, 2017 22:27 Definitely a shell bug, but the PowerShell extension itself doesn't touch the system's file associations. In theory this should be happening when you install VS Code itself, not the PowerShell extension. Did the problem only occur after you installed the PowerShell extension? Could you double-check? |
From @rambutan2000 on April 20, 2017 22:46 I'm 90% it was after the powershell extension install. I tried to open a ps1 file then VS code showed the recommendation bar above the code view. I then installed the extension and tried to run the ps1 file from win explorer. I'd been running ps1 files earlier today and this is the only change to my system. |
From @daviwil on April 20, 2017 22:49 That's extremely strange if so. I wonder if VS Code has some logic for associating the file extension when a language extension for a known file type is installed. FWIW, the only place where the PowerShell file extensions are registered is in the built-in PowerShell syntax extension: https://github.com/Microsoft/vscode/blob/master/extensions/powershell/package.json#L9 |
From @mpearon on May 17, 2017 15:52 I don't think I agree with the OP's observations here. I've only seen this behavior if I changed the default association of PS1s, and I've installed on every machine I've has the opportunity to. |
From @JackUkleja on July 10, 2017 0:2 I just noticed today that my "Run with PowerShell" shell menu item is missing. I'm using VSCode 1.13.1 with the 1.4.1 PowerShell extension. |
From @JackUkleja on July 10, 2017 0:10 @rambutan2000 Your .reg script didn't seem to fix the issue for me. Strange. |
From @f0nt4 on June 13, 2018 17:44 I don't think this is an issue of the extension, but from Code itself. |
From @BrianMakes on December 11, 2018 13:35 I am experiencing the same issue @f0nt4 describes. If VS Code is associated with the PS1 file type, the following behavior occurs: "Run with PowerShell" shell menu item is missing. (after installing VS Code or Powershell Extension) Associating the PS1 filetype with something else (I tested with Notepad) correct the issue. |
It sounds like this issue should be moved to VSCode. One sec |
I am happy to provide additional info or testing if it would be helpful. I use the default "Run with Powershell" menu as well as a couple of custom options manually added to the PS1 associations in the registry. Association VS Code to .ps1 causes them all to disappear. But its non destructive, they all return when the association to VS VCode is removed. |
It doesn't. Also, VS Code only writes to the registry during its setup, never at runtime.
@f0nt4 Please provide steps, if that's the case, as I can't reproduce that. |
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines. Happy Coding! |
@joaomoreno All I did was install VS Code and selected the context menu integration. After that the run with PowerShell option is gone from the context menu on .ps1 files. |
I have the same bug. Installed VS Code, installed the PowerShell plugin, associated VSCode with PS1 files and now the right click context menu has gone. |
From @mjbvz on April 20, 2017 22:16
From @rambutan2000 on April 20, 2017 22:9
After I installed the powershell extension for VS code (from within VS code the usual way) it removed the run powershell context menu option in Windows Explorer
Steps to Reproduce:
Copied from original issue: #25099
Copied from original issue: PowerShell/vscode-powershell#692
The text was updated successfully, but these errors were encountered: