PowerShell / vscode-powershell

Provides PowerShell language and debugging support for Visual Studio Code
https://marketplace.visualstudio.com/items/ms-vscode.PowerShell
MIT License
1.69k stars 481 forks source link

PowerShell Integrated Console prompt does not appear #2719

Closed Liturgist closed 4 years ago

Liturgist commented 4 years ago

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)
ninmonkey commented 4 years ago

The debugger and extension are the 'integrated terminal' The other one is a regular shell. It doesn't boot up instantly. Hit f5, it'll say it's loading, then you'll see it finish. Then hit f5 to use it. After the first load it stays loaded.

Liturgist commented 4 years ago

When VS Code is first started, I get the Welcome doc and a regular shell PowerShell.

Pressing F5:

The PowerShell Integrated Console terminal displays "=====> PowerShell Integrated Console <=====" and nothing else.

Clicking on "Starting PowerShell..." brings up a notification:

Running the contributed command:
'PowerShell.Show.SessionMenu' failed.

How can I tell which PowerShell executable is being used? I have two (2) in the PATH on my system.

C:>where powershell
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

C:>where pwsh
C:\Program Files\PowerShell\7.0.1\7\pwsh.exe
Liturgist commented 4 years ago

It has been "Starting PowerShell..." for over thirty (30) minutes. What should I expect?

TylerLeonhardt commented 4 years ago

Thanks for the info! Can you also attach the logs here so we can get a better idea of what's going on?

TylerLeonhardt commented 4 years ago

Also is this machine locked down in any way?

Liturgist commented 4 years ago

Logs are attached from a recent run. I did not find any text about "error" or "fail" in them. The machine is not locked down in any way.

vscode-powershell.log EditorServices.log StartEditorServices.log

y-halim commented 4 years ago

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

TylerLeonhardt commented 4 years ago

Does this machine use Avecto or BeyondSoft at all?

Is there any enforcement via Group Policy on this machine?

Is there any anti-virus on the machine?

Have you configured the machine in any bizarre ways... That might be non-traditional?

Liturgist commented 4 years ago

Does this machine use Avecto or BeyondSoft at all? No Is there any enforcement via Group Policy on this machine? gpresult /Scope User /v does not report any Is there any anti-virus on the machine? Yes, McAfee Have you configured the machine in any bizarre ways... That might be non-traditional? No

Liturgist commented 4 years ago

Requested Repro-Info provided.

SydneyhSmith commented 4 years ago

Thanks so much for all the information, we are still having some trouble diagnosing the crash...it would be really helpful if you could also attach the payloadlogs--instructions for how to do that are here

Liturgist commented 4 years ago

@SydneyhSmith - Please let me know if I can provide anything else. Thanks.

I would note that there is only "PowerShell Integrated Console" and no plain "powershell" terminal.

There is no "PowerShell Editor Services" item in the drop-down listbox. I chose "PowerShell Extension Logs."

5/26/2020 7:24:41 PM [NORMAL] - Visual Studio Code v1.45.1 64-bit
5/26/2020 7:24:41 PM [NORMAL] - PowerShell Extension v2020.4.0
5/26/2020 7:24:41 PM [NORMAL] - Operating System: Windows 64-bit
5/26/2020 7:24:41 PM [NORMAL] - Language server starting --
5/26/2020 7:24:41 PM [NORMAL] -     PowerShell executable: C:\Program Files\PowerShell\7\pwsh.exe
5/26/2020 7:24:41 PM [NORMAL] -     PowerShell args: -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.4.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\modules' -EnableConsoleRepl -LogLevel 'Verbose' -LogPath 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\logs\1590539081-e61e7b25-a838-4c9c-baf4-ba1792417ad11590539066624\EditorServices.log' -SessionDetailsPath 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\sessions\PSES-VSCode-18956-257991' -FeatureFlags @() 
5/26/2020 7:24:41 PM [NORMAL] -     PowerShell Editor Services args: Import-Module 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2020.4.0' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\modules' -EnableConsoleRepl -LogLevel 'Verbose' -LogPath 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\logs\1590539081-e61e7b25-a838-4c9c-baf4-ba1792417ad11590539066624\EditorServices.log' -SessionDetailsPath 'c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\sessions\PSES-VSCode-18956-257991' -FeatureFlags @() 
5/26/2020 7:24:41 PM [NORMAL] - pwsh.exe started.
5/26/2020 7:24:41 PM [NORMAL] - Waiting for session file
5/26/2020 7:24:43 PM [NORMAL] - Session file found
5/26/2020 7:24:43 PM [NORMAL] - Registering terminal close callback
5/26/2020 7:24:43 PM [NORMAL] - Registering terminal PID log callback
5/26/2020 7:24:43 PM [NORMAL] - pwsh.exe PID: 4444
5/26/2020 7:24:43 PM [NORMAL] - Language server started.
5/26/2020 7:24:43 PM [NORMAL] - {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"\\\\.\\pipe\\PSES_sdyh4nmk.fh2","debugServiceTransport":"NamedPipe","debugServicePipeName":"\\\\.\\pipe\\PSES_cc1qu3nv.wnp"}
5/26/2020 7:24:43 PM [NORMAL] - Connecting to language service on pipe \\.\pipe\PSES_sdyh4nmk.fh2...
5/26/2020 7:24:43 PM [NORMAL] - Language service connected.

Output from PowerShell Integrated Console

VERBOSE: Removing PSReadLine
VERBOSE: Adding AssemblyResolve event handler for new AssemblyLoadContext dependency loading
VERBOSE: Loading EditorServices
VERBOSE: 
== Build Details ==
- Editor Services version: 2.1.0
- Build origin:            Release
- Build time:              2020-04-15 21:53:56       

VERBOSE: 
== Host Startup Configuration Details ==
 - Host name:                 Visual Studio Code Host
 - Host version:              2020.4.0
 - Host profile ID:           Microsoft.VSCode       
 - PowerShell host type:      System.Management.Automation.Internal.Host.InternalHost

 - REPL setting:              PSReadLine
 - Session details path:      c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\sessions\PSES-VSCode-18956-257991
 - Bundled modules path:      c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\modules
 - Additional modules:        PowerShellEditorServices.VSCode
 - Feature flags:

 - Log path:                  c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\logs\1590539081-e61e7b25-a838-4c9c-baf4-ba1792417ad11590539066624\EditorServices.log
 - Minimum log level:         Verbose

 - Profile paths:
   + AllUsersAllHosts:       C:\Program Files\PowerShell\7\profile.ps1
   + AllUsersCurrentHost:    C:\Program Files\PowerShell\7\Microsoft.VSCode_profile.ps1
   + CurrentUserAllHosts:    C:\Users\pwatson\Documents\PowerShell\profile.ps1
   + CurrentUserCurrentHost: C:\Users\pwatson\Documents\PowerShell\Microsoft.VSCode_profile.ps1

VERBOSE: 
== Console Details ==
 - Console input encoding: OEM United States
 - Console output encoding: OEM United States
 - PowerShell output encoding: Unicode (UTF-8)

VERBOSE: 
== PowerShell Details ==
- PowerShell version: 7.0.0
- Language mode:      FullLanguage

VERBOSE: 
== Environment Details ==
 - OS description:  Microsoft Windows 10.0.18363
 - OS architecture: X64
 - Process bitness: 64

VERBOSE: Updated PSModulePath to: 'C:\Users\pwatson\Documents\PowerShell\Modules;C:\Program Files\PowerShell\Modules;c:\program files\powershell\7\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules;c:\Users\pwatson\.vscode\extensions\ms-vscode.powershell-2020.4.0\modules'
VERBOSE: Loading PowerShell Editor Services
VERBOSE: Loading PSES DLL using new assembly load context
VERBOSE: Starting EditorServices
VERBOSE: Starting server, deregistering host logger and registering shutdown listener

                  =====> PowerShell Integrated Console <=====
y-halim commented 4 years ago

The problem disappeared after I restarted my computer.

Liturgist commented 4 years ago

I am glad it is working for you, @y-halin.

I have restarted my computer many times and it continues to fail in the same way.

SydneyhSmith commented 4 years ago

Thanks @Liturgist for the additional information, unfortunately your logs do not look quite as expected, would you mind sharing what settings you have enabled? Thanks again!

Liturgist commented 4 years ago

Thanks @Liturgist for the additional information, unfortunately your logs do not look quite as expected, would you mind sharing what settings you have enabled? Thanks again!

@SydneyhSmith - I would be happy to share the settings. How do I generate a list of the settings? Is it a .json file? If so, where?

TylerLeonhardt commented 4 years ago

@Liturgist you'll wanna grab the file from here:

https://code.visualstudio.com/docs/getstarted/settings#_settings-file-locations

Liturgist commented 4 years ago

Here is the content of "%APPDATA%\Code\User\settings.json". There are a few .json files under "%USERPROFILE%.vscode", but the all appear to be related to azure or Plaster.

C:>type "%APPDATA%\Code\User\settings.json"
{
    "window.zoomLevel": 2
    ,"terminal.integrated.shell.windows":
        "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "workbench.activityBar.visible": true,
    "powershell.developer.powerShellExeIsWindowsDevBuild": true,
    "team.showWelcomeMessage": false,
    "[powershell]": {},
    "files.associations": {
        "*.ps1": "powershell"
    },
    "powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationAfterEveryPipeline",
    "powershell.developer.editorServicesLogLevel": "Verbose"
}
TylerLeonhardt commented 4 years ago

@Liturgist if you remove these settings:

    "powershell.developer.powerShellExeIsWindowsDevBuild": true,
    "[powershell]": {},
    "powershell.developer.editorServicesLogLevel": "Verbose"

does that help at all?

TylerLeonhardt commented 4 years ago

If not, can you add:

"powershell.developer.editorServicesLogLevel": "Diagnostic"

and give us the logs?

Liturgist commented 4 years ago

@TylerLeonhardt - Removing the three (3) lines produced the same failure. I will attach the log files. The result is still:

                  =====> PowerShell Integrated Console <=====

<hang>

EditorServices.log StartEditorServices.log vscode-powershell.log

peter-sahajian commented 4 years ago

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: 6/1/2020 4:08:17 PM [NORMAL] - PowerShell Editor Services args: 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

Liturgist commented 4 years ago

I have the same result with Preview version.

=====> PowerShell Preview Integrated Console v2020.6.0 <=====
<hang>
SydneyhSmith commented 4 years ago

Thanks @Liturgist for all the information, sorry to hear that you are still hitting so many issues, it would be great if you could try setting your default version to Windows PowerShell 5.1 and see if you are able to start. The setting to do that is:

    "powershell.powerShellDefaultVersion": "Windows PowerShell (x64)",

Thanks also @peter-sahajian for the detailed repro steps it would be really helpful if you could also attach the logs--instructions for how to do that are here

Liturgist commented 4 years ago

I changed the setting as you specified, @SydneyhSmith. Although, I do not know how it knew to find powershell.exe 5.1. This produced:

You have an older version of PackageManagement known to cause issues with the PowerShell extension. Would you like to update PackageManagement (You will need to restart the PowerShell extension after)?

followed by:

PackageManagement updated, If you already had PackageManagement loaded in your session, please restart the PowerShell extension.

=== Perhaps there is some improvement. Starting VS code with a .ps1 file produces: (I have the version and profile script location emitted in the profile scripts)

                  =====> PowerShell Integrated Console <=====

5.1.18362.752 AllUsersAllHosts @ C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
5.1.18362.752 CurrentUserAllHosts @ C:\Users\pwatson\Documents\WindowsPowerShell\profile.ps1
PS C:\src\vscode-powershell> 

===

Pressing F5 to start debugging produces: (in Terminal "Task - BuildAll (vscode-powershell)")

> Executing task in folder vscode-powershell: Invoke-Build BuildAll <

Invoke-Build: The term 'Invoke-Build' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.
TylerLeonhardt commented 4 years ago

@Liturgist

PS C:\src\vscode-powershell >

Did you clone this repo or something? It appears you have the extension's source.

Liturgist commented 4 years ago

@TylerLeonhardt, yes I cloned the PowerShell extension. Is that a source of problems?

peter-sahajian commented 4 years ago

Thanks also @peter-sahajian for the detailed repro steps it would be really helpful if you could also attach the logs--instructions for how to do that are here

@SydneyhSmith I have set debug level to Diagnostic and attached a zip of three files that appear in the Logs dir of the extension - ignore the "- Copy" in each of the filenames, it was the easiest to prepare for sharing here.

I produced these logs simply by:

  1. opening the settings and changing to Diagnostic
  2. re-opening the vs code editor
  3. Opening the extension page for ms-vscode.powershell (which triggers the Powershell Integrated Console and the "Starting Powershell" issue)

In my situation, it would seem there is some issue in finding/loading the session

vscode-powershell.zip

SydneyhSmith commented 4 years ago

@peter-sahajian thanks for the additional info, were you also able to capture payload logs? --instructions for how to do that are here Thanks again!

TylerLeonhardt commented 4 years ago

@Liturgist is there a reason why you cloned the PowerShell extension? You shouldn't need that at all unless you're trying to work on the extension itself. What you're seeing when you press F5 is debug configuration for the PowerShell extension.

peter-sahajian commented 4 years ago

@peter-sahajian thanks for the additional info, were you also able to capture payload logs? --instructions for how to do that are here Thanks again!

@SydneyhSmith I have not had a chance to collect those, as I had to uninstall in order to unblock my workload. I will try to add those today. Do the other logs add any insight?

Liturgist commented 4 years ago

@Liturgist is there a reason why you cloned the PowerShell extension? You shouldn't need that at all unless you're trying to work on the extension itself. What you're seeing when you press F5 is debug configuration for the PowerShell extension.

@TylerLeonhardt, I only cloned it to be able to see the code. I did not clone it thinking that it was needed to make it work.

peter-sahajian commented 4 years ago

Hi @SydneyhSmith , I do not get the option in the OUTPUT dropdown to select Powershell Editor Service logs. With the following JSON settings in VSCode,

{
    "powershell.developer.editorServicesLogLevel": "Diagnostic",
    "powershell editor services.trace.server":"verbose"
}

This is what I can see in my dropdown for Output.

image

ninmonkey commented 4 years ago

@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

ArtisanByteCrafter commented 4 years ago

I'm having this issue as well today across two computers.

It loads powershell 7.0 just fine, but refuses to load Windows Powershell 5.1 and hangs indefinitely. All the above logs look normal, and i've tried the insiders and stable of both vscode and the ps extenstion, all to no avail.

Just in case, here are the logs. EditorServices.log StartEditorServices.log vscode-powershell.log

ArtisanByteCrafter commented 4 years ago

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.

SydneyhSmith commented 4 years ago

Thanks @ArtisanByteCrafter for all the information, and sorry to hear that you are hitting this issue...are you using Avecto/BeyondSoft?

ArtisanByteCrafter commented 4 years ago

Avecto/BeyondSoft

I'm not, no

olvd commented 4 years ago

Does this machine use Avecto or BeyondSoft at all?

Is there any enforcement via Group Policy on this machine?

Is there any anti-virus on the machine?

Have you configured the machine in any bizarre ways... That might be non-traditional?

Hi, Can you expand on Avecto? That is my case, experiencing the same issue. Thanks.

badgerbaj commented 4 years ago

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 commented 4 years ago

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

@badgerbaj For some reason I was having issues with v 2020.4.0 personally.

I'll check again (I've had to have it uninstalled to unblock my work).

badgerbaj commented 4 years ago

@peter-sahajian Yes, I have some issues with 2020.4.0 as well, just not as severe. In 2020.4.0, randomly tab complete stops working, as well as inline execution with F8. Reloading the extension clears up those issues though.

peter-sahajian commented 4 years ago

@badgerbaj For whatever reason, mine used to completely hang/break on 2020.4.0

Wondering if the dev team has been able to reproduce? @SydneyhSmith etc etc

SydneyhSmith commented 4 years ago

Unfortunately we still unable to reproduce this--I will mark this as a startup issue

If you think of any other information that might be unique to your system please add that to the thread--thanks!

graphicsxp commented 4 years ago

I just came across this thread. I have the same issue. I start the debugger in VS Code for a powershell script and the terminal just hands on :

=====> PowerShell Integrated Console v2020.6.0 <=====

downgraded to 2020.3.0 and it works fine. anything above that fails to launch debugger

SydneyhSmith commented 4 years ago

@graphicsxp thanks for your comment, that actually sounds like a slightly different issue. Could you please open a new issues and include your debug configuration (in addition to the other requests in the issue template), thanks!

bearkat2173 commented 4 years ago

Stuck in process "You have an older version of PackageManagement known to cause issues with the PowerShell extension. Would you like to update PackageManagement (You will need to restart the PowerShell extension after)?"

I am too

SydneyhSmith commented 4 years ago

Thanks @jdaehler and @bearkat2173 that actually sounds like a separate issue from this one, could you please open a new issue? Thanks!

GAZelenka commented 4 years ago

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.

MoonRaker58 commented 4 years ago

Seems related to this issue but I would gladly open another issue if needed.

I have been able to replicate the same behavior on:

  1. a corporate pc with multiple group policies that I can't view or edit.
  2. on 2 personal machines with no group policies and different antivirus clients.

Before documenting here:

  1. I removed all powershell extension settings from user settings and from workspace settings.
  2. I disabled all extensions except Powershell

Extension version 6.0 and the terminal never progresses past =====> PowerShell Integrated Console v2020.6.0 <===== I check the PowerShell extension log and on last line I find 7/1/2020 12:31:43 PM [ERROR] - <ConsoleFeature>: Unable to instantiate; language client undefined.

The PIC will launch if I down grade to earlier versions I tried both code --install-extension .\PowerShell-Preview-2020.5.0.vsix or code --install-extension .\PowerShell-2020.4.0.vsix

But the extension auto upgrades to 6.0 so on the next reload I'm back to version 6.0 and getting the issue again. I then tried 6.1 preview and it is the same error behavior as 6.0 Windows restart does not change behavior.

Workaround: I've downgraded to 4.0 and have turned off extension auto updating for now.