vscode-powershell: PowerShell Integrated Console prompt does not appear

PowerShell Integrated Console

After installing the Microsoft PowerShell Extension, it appears that I can choose a TERMINAL of “powershell” or “PowerShell Integrated Console.”

The “powershell” TERMINAL appears to work as expected, but no debugging can be done.

“”“Cannot debug or run a PowerShell script until the PowerShell session has started. Wait for the PowerShell session to finish starting and try again. “””

The “PowerShell Integrated Console” TERMINAL does not. It appears hung. It accepts no keyboard entry.

This is based on a fresh install of VS Code from VSCodeUserSetup-x64-1.45.1.exe.

Version: 1.45.1 (user setup)
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:27:35.169Z
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18363
PowerShell extension 2020.4.0
%USERPROFILE%\.vscode\extensions\ms-vscode.powershell-1.8.2\ms-vscode.powershell-1.8.2
    (PS: There is no "examples" subdirectory)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 71 (12 by maintainers)

Most upvoted comments

@rjmholt I get a not authorized error with that build. I did try preview v2020.7.0 and it works so I’m going to use that one for a while. Thanks for the work.

I seem to have pinpointed the exact release that started this behavior for me.

I downgraded every version of the PS Preview extension until the issue was fixed. I had to go back to v2020.1.0 for the issue to finally become resolved. Once i updated to 2020.2.0 or anything more recent, it breaks again. This might be useful for finding the bug, and for anyone who needs a working version in the mean time.

I had problems after restarting VSCode many times with PowerShell extension v2021.2.2 installed. The problem went away as of now by restarting Powershell session without restarting VSCode

@corbob i updated VSC to 1.49 and 2020.8.0-CI.60063 seems to be working properly now

@TylerLeonhardt , I verified that this fixes the issue, thanks 😃

@rjmholt I get a not authorized error with that build. I did try preview v2020.7.0 and it works so I’m going to use that one for a while. Thanks for the work.

Same on both counts. Couldn’t access the linked build, but the preview v2020.7.0 build of the extension worked.

Please try out this build of the extension and let us know how it goes.

That build is based on the changes on the linked PR.

Hi, I have been having the stalled start-up problem regarding “PowerShell.Show.SessionMenu failed…”, and “older version of PackageManagement known to cause issues…” others have outlined above.

My settings.json file had the powershell.powerShellDefaultVersion set to “Windows Powershell (64)” - by changing the default to “PowerShell Core 7.0” in the settings.json file:

"powershell.powerShellDefaultVersion": "PowerShell Core 7.0",
"powershell.powerShellAdditionalExePaths": [
{"exePath": "C:\\Program Files\\PowerShell\\7\\pwsh.exe","versionName": "PowerShell Core 7.0"},
{"exePath": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe","versionName": "PowerShell Core 5.1"}
]

and restarting VS Code, I was able to startup successfully, run code, and access the “Show Session Menu” again.

If I try to set the default back to “Windows Powershell (64)” or “PowerShell Core 5.1” though, the problem recurs.

After Updating VS Code today, I am experiencing this issue with the 2020.6.0 build of PowerShell extension. Downgrading to 2020.4.0 fixes the problem for me.

VS Code details: Version: 1.46.0 (system setup) Commit: a5d1cc28bb5da32ec67e86cc50f84c67cc690321 Date: 2020-06-10T09:03:20.462Z Electron: 7.3.1 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.17763

@peter-sahajian

It’s a lot easier to view, copy, and search logs using the vscode command powershell open powershell extension logs folder If you type open log it will let you view the other 2 log folders as well.

image

It adds syntax highlighting.

Search using the regex \[err\]|exception

image

If it’s open you can right click and it will jump to the actual folder – making it easier to copy.

image

Hello everyone, I just want to point something out as I am observing the same issues with the same error popup and symptoms, and one thing I want to call out is that it occurs when opening/having a Powershell (.ps1) file open. It seems to trigger the Powershell extension, and you will notice in the reproduced steps (and my image attached) that the bottom right indicates VS Code is “Starting Powershell”… this is hanging. When I personally use the command line to uninstall Powershell extension: ms-vscode.powershell, the hanging issue goes away.

This is no matter which version of VS Code I install, or if the ms-vscode.powershell extension is up to date (I had 2020.4.0).

I don’t know if they are related but I wanted to call out my similar experience.

EDIT After the Starting Powershell eventually times out/errors, I get control of VS code back. Updated with more community guideline bug report info:

Q A
Version of VS Code 1.44.2 (system) and 1.45.1 (system)
Your operating system Windows 10
List of extensions that you have installed eamodio.gitlens
mauve.terraform
ms-dotnettools.csharp
ms-python.python
ms-vscode.powershell
redhat.vscode-yaml
Tyriar.shell-launcher
Reproducible steps Have ms-vscode.powershell installed as extension
Open vs code ~with a .ps1 file in editor~
Wait for error message to pop up
Expected vs. saw VS Code should open the file with no issues

Eventually the VS Code Powershell startup fails, and this is what I see in the logs:

6/1/2020 4:08:17 PM [NORMAL] - Visual Studio Code v1.44.2 64-bit 6/1/2020 4:08:17 PM [NORMAL] - PowerShell Extension v2020.4.0 6/1/2020 4:08:17 PM [NORMAL] - Operating System: Windows 64-bit 6/1/2020 4:08:17 PM [NORMAL] - Language server starting – 6/1/2020 4:08:17 PM [NORMAL] - PowerShell executable: C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe 6/1/2020 4:08:17 PM [NORMAL] - PowerShell args: <omitted> 6/1/2020 4:08:17 PM [NORMAL] - PowerShell Editor Services args: <omitted> 6/1/2020 4:08:17 PM [NORMAL] - powershell.exe started. 6/1/2020 4:08:17 PM [NORMAL] - Waiting for session file 6/1/2020 4:10:17 PM [NORMAL] - Error occurred retrieving session file: Timed out waiting for session file to appear. 6/1/2020 4:10:17 PM [NORMAL] - Language server startup failed. 6/1/2020 4:10:17 PM [ERROR] - The language service could not be started: 6/1/2020 4:10:17 PM [ERROR] - Timed out waiting for session file to appear.

Images image

Note: this has been discussed a bit in the vscode repo, found here https://github.com/microsoft/vscode/issues/98822

I have the same issue with the same vesion of VS Code that I installed 3 days ago.

Version: 1.45.1 (user setup) Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a Date: 2020-05-14T08:27:35.169Z Electron: 7.2.4 Chrome: 78.0.3904.130 Node.js: 12.8.1 V8: 7.8.279.23-electron.0 OS: Windows_NT x64 10.0.18362

vscode-powershell.log EditorServices.log StartEditorServices.log