Skip to content

Loading the PowerShell extension is taking longer than expected #4371

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
5 of 6 tasks
dmumladze opened this issue Jan 13, 2023 · 36 comments
Closed
5 of 6 tasks

Loading the PowerShell extension is taking longer than expected #4371

dmumladze opened this issue Jan 13, 2023 · 36 comments
Labels
Issue-Bug A bug to squash. Resolution-Answered Will close automatically.

Comments

@dmumladze
Copy link

dmumladze commented Jan 13, 2023

Prerequisites

  • I have written a descriptive issue title.
  • I have searched all open and closed issues to ensure it has not already been reported.
  • I have read the troubleshooting guide.
  • I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
  • I have verified that I am using the latest version of Visual Studio Code and the PowerShell extension.
  • If this is a security issue, I have read the security issue reporting guidance.

Summary

I cannot debug PowerShell files in Visual Studio Code. As soon as I start vscode, it displays following two errors in the Terminal:

Import-Module: Could not load file or assembly 'System.Runtime, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.

Start-EditorServices: The term 'Start-EditorServices' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Then the Terminal pane clears and several popup alerts appear saying PowerShell failed to start.

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.22000
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visual Studio Code Version

1.74.3
97dec172d3256f8ca4bfb2143f3f76b503ca0534
x64

Extension Version

Steps to Reproduce

N/A

Visuals

image

Logs

1/13/2023 10:55:51 AM [NORMAL] - Visual Studio Code v1.74.3 64-bit
1/13/2023 10:55:51 AM [NORMAL] - Language server starting --
1/13/2023 10:55:51 AM [NORMAL] - PowerShell Extension v2022.12.1
1/13/2023 10:55:51 AM [NORMAL] - PowerShell executable: C:\Program Files\PowerShell\7\pwsh.exe
1/13/2023 10:55:51 AM [NORMAL] - Operating System: Windows 64-bit
1/13/2023 10:55:51 AM [NORMAL] - PowerShell args: -NoProfile -ExecutionPolicy Bypass -Command Import-Module 'c:\Users\david.vscode\extensions\ms-vscode.powershell-2022.12.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.12.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\david.vscode\extensions\ms-vscode.powershell-2022.12.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\david\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1673625351-7c79dfb0-5e11-49f2-8f28-22219e4a7c461673625349867\EditorServices.log' -SessionDetailsPath 'c:\Users\david\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-28444-434897.json' -FeatureFlags @()
1/13/2023 10:55:51 AM [NORMAL] - PowerShell Editor Services args: Import-Module 'c:\Users\david.vscode\extensions\ms-vscode.powershell-2022.12.1\modules\PowerShellEditorServices\PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.12.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath 'c:\Users\david.vscode\extensions\ms-vscode.powershell-2022.12.1\modules' -EnableConsoleRepl -StartupBanner '' -LogLevel 'Normal' -LogPath 'c:\Users\david\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\logs\1673625351-7c79dfb0-5e11-49f2-8f28-22219e4a7c461673625349867\EditorServices.log' -SessionDetailsPath 'c:\Users\david\AppData\Roaming\Code\User\globalStorage\ms-vscode.powershell\sessions\PSES-VSCode-28444-434897.json' -FeatureFlags @()
1/13/2023 10:55:51 AM [NORMAL] - pwsh.exe started.
1/13/2023 10:55:51 AM [NORMAL] - Waiting for session file...
1/13/2023 10:56:22 AM [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.
1/13/2023 10:59:54 AM [NORMAL] - Timed out waiting for session file to appear!
1/13/2023 10:59:54 AM [ERROR] - PowerShell process failed to start:
1/13/2023 10:59:54 AM [ERROR] - Timed out waiting for session file to appear!
1/13/2023 10:59:54 AM [ERROR] - Unknown session status 'undefined' with reason 'undefined

@dmumladze dmumladze added the Issue-Bug A bug to squash. label Jan 13, 2023
@ghost ghost added the Needs: Triage Maintainer attention needed! label Jan 13, 2023
@dmumladze
Copy link
Author

This popup appears several minutes later:
image

@andyleejordan
Copy link
Member

Hi,

Could you please provide more logging and environment information by following these steps?

Thanks!

@andyleejordan andyleejordan added Needs: Author Feedback Please give us the requested feedback! and removed Needs: Triage Maintainer attention needed! labels Jan 14, 2023
@schwinbp
Copy link

I am getting this too since upgrading to MacOS Ventura. Is there some permissions we need to give in System Settings to allow this extension to run?
Workaround is I can just run pwsh in the standard vs code terminal and that works fine.

@schwinbp
Copy link

My Logs...

1/18/2023 1:27:13 PM [NORMAL] - Visual Studio Code v1.74.3 64-bit

1/18/2023 1:27:13 PM [NORMAL] - Creating log directory at: 'file:///Users/schwinbp/Library/Application%20Support/Code/User/globalStorage/ms-vscode.powershell/logs/1674066432-d4869f1f-9c9d-43c0-a908-2589a79c9bd21674066431924'

1/18/2023 1:27:13 PM [NORMAL] - PowerShell Extension v2022.12.1

1/18/2023 1:27:13 PM [NORMAL] - Operating System: MacOS 64-bit

1/18/2023 1:27:14 PM [NORMAL] - Language server starting --

1/18/2023 1:27:14 PM [NORMAL] - PowerShell executable: /usr/local/bin/pwsh

1/18/2023 1:27:14 PM [NORMAL] - PowerShell args: -Login -NoProfile -EncodedCommand ********

1/18/2023 1:27:14 PM [NORMAL] - PowerShell Editor Services args: Import-Module '/Users/schwinbp/.vscode/extensions/ms-vscode.powershell-2022.12.1/modules/PowerShellEditorServices/PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.12.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath '/Users/schwinbp/.vscode/extensions/ms-vscode.powershell-2022.12.1/modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2022.12.1
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Normal' -LogPath '/Users/schwinbp/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/logs/1674066432-d4869f1f-9c9d-43c0-a908-2589a79c9bd21674066431924/EditorServices.log' -SessionDetailsPath '/Users/schwinbp/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-21752-370789.json' -FeatureFlags @()

1/18/2023 1:27:14 PM [NORMAL] - pwsh started.

1/18/2023 1:27:14 PM [NORMAL] - Waiting for session file...

1/18/2023 1:27:44 PM [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.

1/18/2023 1:31:15 PM [NORMAL] - Timed out waiting for session file to appear!

1/18/2023 1:31:15 PM [ERROR] - PowerShell process failed to start:

1/18/2023 1:31:15 PM [ERROR] - Timed out waiting for session file to appear!

1/18/2023 1:31:15 PM [ERROR] - Unknown session status 'undefined' with reason 'undefined

@andyleejordan
Copy link
Member

Is there some permissions we need to give in System Settings to allow this extension to run?

That is probably the case. But can you enable diagnostic logging?

@schwinbp
Copy link

1/18/2023 2:06:59 PM [DIAGNOSTIC] - Loaded settings:
{
"powerShellAdditionalExePaths": {},
"powerShellDefaultVersion": "",
"powerShellExePath": "",
"promptToUpdatePowerShell": false,
"startAsLoginShell": {
"osx": true,
"linux": false
},
"startAutomatically": true,
"enableProfileLoading": true,
"helpCompletion": "BlockComment",
"scriptAnalysis": {
"enable": true,
"settingsPath": "PSScriptAnalyzerSettings.psd1"
},
"debugging": {
"createTemporaryIntegratedConsole": false
},
"developer": {
"featureFlags": [],
"bundledModulesPath": "../../PowerShellEditorServices/module",
"editorServicesLogLevel": "Diagnostic",
"editorServicesWaitForDebugger": false,
"waitForSessionFileTimeoutSeconds": 240
},
"codeFormatting": {
"autoCorrectAliases": false,
"avoidSemicolonsAsLineTerminators": false,
"preset": "Custom",
"openBraceOnSameLine": true,
"newLineAfterOpenBrace": true,
"newLineAfterCloseBrace": true,
"pipelineIndentationStyle": "NoIndentation",
"whitespaceBeforeOpenBrace": true,
"whitespaceBeforeOpenParen": true,
"whitespaceAroundOperator": true,
"whitespaceAfterSeparator": true,
"whitespaceBetweenParameters": false,
"whitespaceInsideBrace": true,
"addWhitespaceAroundPipe": true,
"trimWhitespaceAroundPipe": false,
"ignoreOneLineBlock": true,
"alignPropertyValuePairs": true,
"useConstantStrings": false,
"useCorrectCasing": false
},
"integratedConsole": {
"showOnStartup": true,
"startInBackground": false,
"focusConsoleOnExecute": true,
"useLegacyReadLine": false,
"forceClearScrollbackBuffer": false,
"suppressStartupBanner": false
},
"sideBar": {
"CommandExplorerVisibility": true,
"CommandExplorerExcludeFilter": []
},
"pester": {
"useLegacyCodeLens": true,
"outputVerbosity": "FromPreference",
"debugOutputVerbosity": "Diagnostic"
},
"buttons": {
"showRunButtons": true,
"showPanelMovementButtons": false
},
"cwd": "",
"enableReferencesCodeLens": true,
"analyzeOpenDocumentsOnly": false
}
1/18/2023 2:07:00 PM [NORMAL] - Language server starting --
1/18/2023 2:07:00 PM [NORMAL] - pwsh started.
1/18/2023 2:07:00 PM [NORMAL] - PowerShell executable: /usr/local/bin/pwsh
1/18/2023 2:07:00 PM [NORMAL] - Waiting for session file...
1/18/2023 2:07:00 PM [NORMAL] - PowerShell args: -Login -NoProfile -EncodedCommand SQBtAHAAbwByAHQALQBNAG8AZAB1AGw******
1/18/2023 2:07:00 PM [NORMAL] - PowerShell Editor Services args: Import-Module '/Users/schwinbp/.vscode/extensions/ms-vscode.powershell-2022.12.1/modules/PowerShellEditorServices/PowerShellEditorServices.psd1'; Start-EditorServices -HostName 'Visual Studio Code Host' -HostProfileId 'Microsoft.VSCode' -HostVersion '2022.12.1' -AdditionalModules @('PowerShellEditorServices.VSCode') -BundledModulesPath '/Users/schwinbp/.vscode/extensions/ms-vscode.powershell-2022.12.1/modules' -EnableConsoleRepl -StartupBanner "PowerShell Extension v2022.12.1
Copyright (c) Microsoft Corporation.

https://aka.ms/vscode-powershell
Type 'help' to get help.
" -LogLevel 'Diagnostic' -LogPath '/Users/schwinbp/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/logs/1674068819-4c14146b-6a8b-435b-ba43-ab7681d2a3c21674068808976/EditorServices.log' -SessionDetailsPath '/Users/schwinbp/Library/Application Support/Code/User/globalStorage/ms-vscode.powershell/sessions/PSES-VSCode-22402-204135.json' -FeatureFlags @()
1/18/2023 2:06:59 PM [NORMAL] - Visual Studio Code v1.74.3 64-bit
1/18/2023 2:06:59 PM [NORMAL] - PowerShell Extension v2022.12.1
1/18/2023 2:06:59 PM [NORMAL] - Operating System: MacOS 64-bit
1/18/2023 2:07:30 PM [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.
1/18/2023 2:11:01 PM [NORMAL] - Timed out waiting for session file to appear!
1/18/2023 2:11:01 PM [ERROR] - PowerShell process failed to start:
1/18/2023 2:11:01 PM [ERROR] - Timed out waiting for session file to appear!
1/18/2023 2:11:01 PM [ERROR] - Unknown session status 'undefined' with reason 'undefined

@dmumladze
Copy link
Author

Hi,

Could you please provide more logging and environment information by following these steps?

Thanks!

Only logs I get are these attached. There're no logs in the extensions folder because the extension isn't loaded at that time.

vscode-powershell.log

@ghost ghost added Needs: Maintainer Attention Maintainer attention needed! and removed Needs: Author Feedback Please give us the requested feedback! labels Jan 18, 2023
@AdamGrossTX
Copy link

I was able to repro this issue and resolve it by switching "powershell.powerShellDefaultVersion": "PowerShell (x64)", to "powershell.powerShellDefaultVersion": "Windows PowerShell (x64)", in my settings.json. It appears there's an issue where the PowerShell extension doesn't load if PowerShell 7 is the default PowerShell used.

@dmumladze
Copy link
Author

I was able to repro this issue and resolve it by switching "powershell.powerShellDefaultVersion": "PowerShell (x64)", to "powershell.powerShellDefaultVersion": "Windows PowerShell (x64)", in my settings.json. It appears there's an issue where the PowerShell extension doesn't load if PowerShell 7 is the default PowerShell used.

Neither settings worked for me.

@andyleejordan
Copy link
Member

Hi all, is this still recurring with v2023.1.0?

@schwinbp
Copy link

Yes this is occurring on the latest version v2023.1.0.

The workaround mentioned above does not work for me because I am running on a managed work pc that still has PS v5 as the Windows Powershell version. So now when I run all my scripts developed in PS 7 core it has to re-download all my modules and then fails on PS7-specific issues.

@soulshined
Copy link

soulshined commented Jan 27, 2023

This is a major roadblock. As of now, the only thing that at least gets this from failing is by doing what @dmumladze mentioned by setting the powershell.powerShellDefaultVersion to Windows Powershell (x64) AND installing a different version: click on the extension cog and install version 2022.12.1

The most recent version this works without changing any settings or keeping everything as I have been, is version 2022.11.0

Edit: I've since noticed that some of the built-in functions like ConvertFrom-Markdown can't be found when running scripts through the extension. ConvertFrom-Markdown is only available starting in 7 so I changed the powershell.powerShellDefaultVersion to PowerShell 7 (x64) and it starts to fail again. I think schwinbp is onto something about it only being pwsh 7 specific. For now, I just don't use the extension and run scripts by way of a task which uses normal terminal conventions

@pcgeek86
Copy link
Contributor

pcgeek86 commented Jan 31, 2023

Same issue here. Haven't used PowerShell Extension on MacOS for a while, but just tried opening it up and ran into this problem. This computer is running MacOS Ventura.

  • Intellisense does not work
  • Errors show up when PowerShell Extension initializes (see below)

Screenshot 2023-01-31 at 2 30 56 AM

Unknown session status 'undefined' with reason 'undefined


1/31/2023 2:23:08 AM [NORMAL] - pwsh started.

1/31/2023 2:23:08 AM [NORMAL] - Waiting for session file...

1/31/2023 2:23:38 AM [WARNING] - Loading the PowerShell extension is taking longer than expected. If you're using privilege enforcement software, this can affect start up performance.

1/31/2023 2:27:09 AM [NORMAL] - Timed out waiting for session file to appear!

1/31/2023 2:27:09 AM [ERROR] - PowerShell process failed to start: 

1/31/2023 2:27:09 AM [ERROR] - Timed out waiting for session file to appear!

1/31/2023 2:27:09 AM [ERROR] - Unknown session status 'undefined' with reason 'undefined

In my VSCode settings, I have the following configuration:

    "powershell.powerShellAdditionalExePaths": {
        "pwshcore": "c:\\users\\trevorsullivan\\scoop\\apps\\pwsh\\current\\pwsh.exe",
        "pwshcoremacos": "/usr/local/microsoft/powershell/7/pwsh"
    }

Workaround

It seems that using Mac Homebrew to upgrade PowerShell Core from 7.3.1 to 7.3.2 immediately fixed the issue.


1/31/2023 2:36:50 AM [NORMAL] - pwsh started.

1/31/2023 2:36:50 AM [NORMAL] - Waiting for session file...

1/31/2023 2:36:52 AM [NORMAL] - Session file found!

1/31/2023 2:36:52 AM [NORMAL] - pwsh PID: 86360

1/31/2023 2:36:52 AM [NORMAL] - Language server started.

1/31/2023 2:36:52 AM [NORMAL] - Connecting to language service on pipe: /var/folders/bw/yc3krqjs11bdctkqj_clqf4c0000gn/T/CoreFxPipe_PSES_b5wupn4l.ct0

1/31/2023 2:36:52 AM [NORMAL] - Session details: {"status":"started","languageServiceTransport":"NamedPipe","languageServicePipeName":"/var/folders/bw/yc3krqjs11bdctkqj_clqf4c0000gn/T/CoreFxPipe_PSES_b5wupn4l.ct0","debugServiceTransport":"NamedPipe","debugServicePipeName":"/var/folders/bw/yc3krqjs11bdctkqj_clqf4c0000gn/T/CoreFxPipe_PSES_wwmjaipm.xih"}

1/31/2023 2:36:52 AM [NORMAL] - Language service socket connected.

@andyleejordan
Copy link
Member

I've so far been unable to repro 😭

It seems that using Mac Homebrew to upgrade PowerShell Core from 7.3.1 to 7.3.2 immediately fixed the issue.

Glad to hear this, perhaps a step others can try? (Updating to 7.3.2 that is.)

@andyleejordan
Copy link
Member

andyleejordan commented Jan 31, 2023

Hey we were reviewing in triage and @SeeminglyScience caught that @dmumladze, you're trying to use PowerShell 7.1 still. However, that version of PowerShell is past its official end of life (as of May 2022), and therefore support for it was removed, hence the error you're getting. Please upgrade to PowerShell 7.2 LTS or 7.3, latest release.

@andyleejordan
Copy link
Member

@schwinbp, @AdamGrossTX, and @soulshined can you please confirm exactly what version of PowerShell you're using?

@andyleejordan andyleejordan added Resolution-Answered Will close automatically. and removed Needs: Maintainer Attention Maintainer attention needed! labels Jan 31, 2023
@soulshined
Copy link

@schwinbp, @AdamGrossTX, and @soulshined can you please confirm exactly what version of PowerShell you're using?

> $PSVersionTable.PSVersion

Major  Minor  Patch  PreReleaseLabel BuildLabel
-----  -----  -----  --------------- ----------
7        0        2

I can't update my PowerShell, it's locked under a group policy. I'll continue to uses default tasks.

I see now in the Readme the required version is clearly stated, but as demonstrated by the previous reports, the surprise of the error messages and lack of concise reasoning was a tad frustrating to deal with. I think a more of a direct message in the alert box or log in the output channel would clear a lot of this up instead of what it does now would be helpful. It just runs and runs until it says "taking too long" or status 'undefined' reason 'undefined'. Those are very ambiguous and hard to troubleshoot, therefore hard to get you the info you need to reproduce.

But thanks for the update!

@andyleejordan
Copy link
Member

@soulshined please inform your administrator that the group policy is enforcing an end-of-life version of PowerShell. That is, it is not receiving any updates, nor is the underlying version of .NET and this is actually quite risky:

Your use of out-of-support .NET versions may put your applications, application data, and computing environment at risk. You are strongly recommended to not use out-of-support software.

You are right, a better error message would be great. We've so far not done a "pre-emptive" version test of PowerShell because of the amount of time it takes to determine the version of PowerShell being executed. That is, PowerShell has to start before we can get its version (like, we'd need to run pwsh -Command '$PSVersionTable') and that can actually take quite some time, so it would slow down startup significantly. But you're giving me the idea that, upon failure to start the server, we should then run that command and check the version, and if it's out of date, say so.

Hey, at least we got the update notifier working 😄

@soulshined
Copy link

@soulshined please inform your administrator that the group policy is enforcing an end-of-life version of PowerShell. That is, it is not receiving any updates, nor is the underlying version of .NET and this is actually quite risky:

Your use of out-of-support .NET versions may put your applications, application data, and computing environment at risk. You are strongly recommended to not use out-of-support software.

You are right, a better error message would be great. We've so far not done a "pre-emptive" version test of PowerShell because of the amount of time it takes to determine the version of PowerShell being executed. That is, PowerShell has to start before we can get its version (like, we'd need to run pwsh -Command '$PSVersionTable') and that can actually take quite some time, so it would slow down startup significantly. But you're giving me the idea that, upon failure to start the server, we should then run that command and check the version, and if it's out of date, say so.

Hey, at least we got the update notifier working 😄

Not the end of the world to use tasks. Just glad it's sorted out and future users can find this. And trust me I would love to update. Enterprise is enterprise what ya gonna do.

Sorry I don't know what all goes into the extension as I haven't looked that deep into it. If vscode doesn't offer prequiste flags outside of package json I would assume spawning a simple node child process to grab the version would suffice prior to trying to load the language server and such. Just slightly confused by your verbiage of 'Powershell must start' But I'll leave that up to you pros! I'm just living in your world

@andyleejordan
Copy link
Member

If vscode doesn't offer prequiste flags outside of package json I would assume spawning a simple node child process to grab the version would suffice prior to trying to load the language server and such.

This is exactly what I meant, it takes a few seconds to do this because .NET / PowerShell is slow to start, so doing it every time before we start the server has been a no-go. But the idea you gave me in this thread is to do it after connection fails, and use the info to make an informed error message.

@teekay
Copy link

teekay commented Feb 2, 2023

I had the exact same problem, and upgrading PowerShell from 7.1.0 to 7.3.1, which is currently the last version, solved this for me.

@ghost ghost closed this as completed Feb 3, 2023
@ghost
Copy link

ghost commented Feb 3, 2023

This issue has been marked as answered and has not had any activity in a day. It has been automatically closed for housekeeping purposes.

@Ted-A
Copy link

Ted-A commented Feb 8, 2023

I was experiencing the same issue. Downgrading the VS Code PS extension version to 2022.11.0 resolved the issue.

Error with the latest PS extension:
image

Current PS Version:
image

VS Code PS Extension version:
image

@andyleejordan
Copy link
Member

@Ted-A you're trying to use PowerShell 7.1 still. However, that version of PowerShell is past its official end of life (as of May 2022), and therefore support for it was removed, hence the error you're getting. Please upgrade to PowerShell 7.2 LTS or 7.3, latest release.

@schwinbp
Copy link

Hey gang...sorry for delayed response but I was on vacation. I just upgraded to PS 7.3.* and it is working now. Upgrade took awhile. Thanks for the help.

@andyleejordan
Copy link
Member

Great news, thanks for the follow up @schwinbp!

@vexx32
Copy link

vexx32 commented Feb 16, 2023

So I get deprecating these versions, I do.

Is there really no way to give users a better error, though? That's a really confusing error to get and doesn't at all point anyone in the right direction to fix things. A short and sweet "the version of PowerShell you're using might be out of date, please update it" would be significantly more helpful.

@pcgeek86
Copy link
Contributor

Is there really no way to give users a better error, though?

Providing vague and obscure error messages is the "way of the developer." How dare you expect a developer to actually expose useful error messages with suggested corrective actions?

@SeeminglyScience
Copy link
Collaborator

Is there really no way to give users a better error, though?

There sure is! Andy talks about the plan to add one a few comments up :P (here) (I missed it too initially FWIW)

@aarondel4
Copy link

I was experiencing the same issue. Downgrading the VS Code PS extension version to 2022.11.0 resolved the issue.

Same here. Maybe because this extension uses the year as it's major version number, this issue crops up in January to bring work to a halt.

The downgrade option is found by going to Extensions, scrolling through your Installed extensions to find your Powershell extension. Uncheck Auto Update, then hit the arrow next to Uninstall to install specific version.

Image

@andyleejordan
Copy link
Member

@aarondel4 you should not be downgrading the extension. This issue stems from using PowerShell versions that are past end-of-life. You need to update PowerShell.

@aarondel4
Copy link

@aarondel4 you should not be downgrading the extension. This issue stems from using PowerShell versions that are past end-of-life. You need to update PowerShell.

@andyleejordan you should understand the constraints that limit the ability to upgrade PowerShell. This is a viable workaround in certain constrained environments where appropriate caution is taken. Thanks.

@JustinGrote
Copy link
Collaborator

JustinGrote commented Jan 29, 2025

If you are in an environment that cares more about running an unsupported version of PowerShell, with all the potential CVEs and vulnerabilities that will go unfixed because it is unsupported, than it does the effort to run an MSI or automated windows update to the latest LTS version at a minimum (7.4 as of this writing), then yes, I suppose it would be a viable workaround, but I don't recommend it.

@aarondel4
Copy link

If you are in an environment that cares more about running an unsupported version of PowerShell, with all the potential CVEs and vulnerabilities that will go unfixed because it is unsupported, than it does the effort to run an MSI or automated windows update to the latest LTS version at a minimum (7.4 as of this writing), then yes, I suppose it would be a viable workaround, but I don't recommend it.

You don't understand what a constrained environment is. I leave it at that since you're taking such an adversarial stance. Not really pertinent to this thread.

@JustinGrote
Copy link
Collaborator

You don't understand what a constrained environment is. I leave it at that since you're taking such an adversarial stance. Not really pertinent to this thread.

Constrained or not, the version you are running is unsupported. Simple as that.

@aarondel4
Copy link

You don't understand what a constrained environment is. I leave it at that since you're taking such an adversarial stance. Not really pertinent to this thread.

Constrained or not, the version you are running is unsupported. Simple as that.

I didn't request support. Simple as that.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Resolution-Answered Will close automatically.
Projects
None yet
Development

No branches or pull requests