Skip to content

Running the contributed command: 'PowerShell.ShowSessionMenu' failed. #2895

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

Closed
jithinvijayan opened this issue Aug 18, 2020 · 14 comments
Closed
Labels
Resolution-Duplicate Will close automatically.

Comments

@jithinvijayan
Copy link

Issue Description

I recently installed vscode and the powershell extension. I am since seeing the error "Running the contributed command: 'PowerShell.ShowSessionMenu' failed." whenever vscode starts up. As a result, while the powershell terminal works fine, none of the powershell extension features in the editor works (like command completion, displaying switches, etc).

Similar to issue#[2822](#2822
EditorServices.log
StartEditorServices.log
vscode-powershell.log

), however I don't have PS core installed.

Attached Logs

Follow the instructions in the README about
capturing and sending logs.

Environment Information

Visual Studio Code

Name Version
Operating System Windows_NT x64 10.0.17763
VSCode 1.48.0
PowerShell Extension Version 2020.6.0

PowerShell Information

Name Value
PSVersion 5.1.17763.1007
PSEdition Desktop
PSCompatibleVersions 1.0 2.0 3.0 4.0 5.0 5.1.17763.1007
BuildVersion 10.0.17763.1007
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Visual Studio Code Extensions

Visual Studio Code Extensions(Click to Expand)
Extension Author Version
code-settings-sync Shan 3.4.3
powershell ms-vscode 2020.6.0
python ms-python 2020.8.101144
shellcheck timonwong 0.9.0
vscode-icons vscode-icons-team 10.2.0
@ghost ghost added the Needs: Triage Maintainer attention needed! label Aug 18, 2020
@SydneyhSmith
Copy link
Collaborator

Thanks @jithinvijayan looks like the same issue as #2719 this fix is released in our latest PowerShell Preview extension release...could you please give that a try and see if you are still hitting this issue

@SydneyhSmith SydneyhSmith added Resolution-Duplicate Will close automatically. and removed Needs: Triage Maintainer attention needed! labels Aug 18, 2020
@jithinvijayan
Copy link
Author

Thanks @SydneyhSmith, I uninstalled the PowerShell extension, reloaded vscode, then installed PowerShell Preview extension. Still seeing the same issue.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Aug 18, 2020
@TylerLeonhardt
Copy link
Member

Sorry @jithinvijayan, that fix will be in the next release. Our bad on that. We hope to get a new version out sometime next week or so.

@TylerLeonhardt TylerLeonhardt removed the Needs: Maintainer Attention Maintainer attention needed! label Aug 18, 2020
@jithinvijayan
Copy link
Author

Session logs after using PowerShell preview extension:
EditorServices.log
StartEditorServices.log
vscode-powershell.log

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Aug 18, 2020
@jithinvijayan
Copy link
Author

Looks like the issue was to do with the executionpolicy. I am running Win 10 1809, and the execution policy for currentuser was Restricted. After changing that to RemoteSigned, I am not seeing that issue anymore. Uninstalled the preview extension and installed the powershell extension, and its all good. So, looks like the executionpolicy being set to restricted to currentuser was the issue. That should be the default for all Win 10 client systems though, so could be a pre-requisite that needs to be clarified perhaps?

@jithinvijayan
Copy link
Author

Thanks team,

@SydneyhSmith SydneyhSmith removed the Needs: Maintainer Attention Maintainer attention needed! label Aug 20, 2020
@noeltupas
Copy link

I'm still seeing this issue even after setting currentuser to unrestricted.

@ghost ghost added the Needs: Maintainer Attention Maintainer attention needed! label Sep 25, 2020
@corbob
Copy link
Contributor

corbob commented Sep 25, 2020

I'm still seeing this issue even after setting currentuser to unrestricted.

@noeltupas when you run Get-ExecutionPolicy what do you have returned? The Execution Policy is evaluated in order: Local Machine, Current User, Process, User Policy, Machine Policy. If the Process or Policies have a different setting, you will end up with those settings. To find out which policy is being applied you can run Get-ExecutionPolicy -List and the topmost setting that is not Undefined will be the one that's applied.

@noeltupas
Copy link

CurrentUser and LocalMachine are set to RemoteSigned, MachinePolicy UserPolicy and Process are set to Undefined

@noeltupas
Copy link

Anyone else have useful guidance on this?

@seraphim72
Copy link

seraphim72 commented Oct 2, 2020

Running into this exact same issue. Local Machine set to RemoteSigned. All others set to undefined.

10/2/2020 10:14:25 AM [NORMAL] - powershell.exe started.
10/2/2020 10:14:25 AM [NORMAL] - Waiting for session file
10/2/2020 10:18:26 AM [NORMAL] - Timed out waiting for session file to appear.
10/2/2020 10:18:26 AM [NORMAL] - Language server startup failed.
10/2/2020 10:18:26 AM [ERROR] - The language service could not be started:
10/2/2020 10:18:26 AM [ERROR] - Error: Timed out waiting for session file to appear.


Upgrading to ### VSCode version: 1.50.0 93c2f0fbf16c5a4b10e4d5f89737d9c2c25488a3 x64 fixed this problem for me.

@adrianvaneeden
Copy link

Running into this exact same issue. Local Machine set to RemoteSigned. All others set to undefined.

Same. I'm running PowerShell 7 though. Not sure if this would make a difference?

@damien381
Copy link

Following this

@corbob
Copy link
Contributor

corbob commented Oct 8, 2020

Someone that's still experiencing this and it's not the execution policy should probably open a new issue. Op closed this after finding the solution to their issue. Make sure to gather logs and submit them to assist with diagnosing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution-Duplicate Will close automatically.
Projects
None yet
Development

No branches or pull requests

8 participants