Skip to content
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

Extension stuck on loading #5057

Open
2 of 6 tasks
opmdsm opened this issue Oct 4, 2024 · 12 comments
Open
2 of 6 tasks

Extension stuck on loading #5057

opmdsm opened this issue Oct 4, 2024 · 12 comments
Labels

Comments

@opmdsm
Copy link

opmdsm commented Oct 4, 2024

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

Hi,

This is the second time when I face this situation.
Scenario: Fresh install of Visual Studio Code (VSC), then install PowerShell extension from Microsoft. Upon requesting to trust publisher, I press A (always trust) in the terminal window and then nothing happens. I leave it for 1-2h without nothing to happen and then force to stop it. Restarting VSC and Windows PowerShell (x64) is never loading, the bottom-right icon is spinning forever. Switching to Windows PowerShell (x86) is working. The first time when this happened was 2-3 years ago and I remember I've spent also lot of time trying to figure out how to fix this. I discovered the fix by mistake: Found a post about OneDrive somehow corrupting some PowerShell (psm/psd) files from Documents folder or someting. Running chkdsk from command propmt fixed the issue. But now this doesn't seems to have any effect. Any ideas what can I do?

Thanks,
Marius.

PowerShell Version

Name                           Value                                                                                                                   
----                           -----                                                                                                                   
PSVersion                      5.1.22621.4249                                                                                                          
PSEdition                      Desktop                                                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                                                 
BuildVersion                   10.0.22621.4249                                                                                                         
CLRVersion                     4.0.30319.42000                                                                                                         
WSManStackVersion              3.0                                                                                                                     
PSRemotingProtocolVersion      2.3                                                                                                                     
SerializationVersion           1.1.0.1                                                                                                                 

Name             : Windows PowerShell ISE Host
Version          : 5.1.22621.4249
InstanceId       : 64347789-db94-40f5-9118-5d2a0c2cc76b
UI               : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture   : en-US
CurrentUICulture : en-US
PrivateData      : Microsoft.PowerShell.Host.ISE.ISEOptions
DebuggerEnabled  : True
IsRunspacePushed : False
Runspace         : System.Management.Automation.Runspaces.LocalRunspace

Visual Studio Code Version

1.94.0

Extension Version

v2024.2.2

Steps to Reproduce

See Summary section

Visuals

No response

Logs

No response

@opmdsm opmdsm added Issue-Bug A bug to squash. Needs: Triage Maintainer attention needed! labels Oct 4, 2024
@opmdsm
Copy link
Author

opmdsm commented Oct 4, 2024

Screenshot 2024-10-04 125638

This is how terminal looks like

@opmdsm
Copy link
Author

opmdsm commented Oct 4, 2024

Screenshot 2024-10-04 134407

@tonysathre
Copy link

tonysathre commented Oct 4, 2024

Been having the same issue for the past week or so. Seems to only happen when switching the session to PS 5.1. My workaround is to switch the shell by running powershell in my pwsh session, instead of using the PowerShell: Show Session Menu -> Switch to: command.

@JustinGrote
Copy link
Collaborator

Thanks for the submission! The most common reason we've been seeing this lately is an antivirus program blocking or halting the execution of the PowerShell extension. Do you have any antivirus programs installed?

Otherwise there's not much we can do without a reproducible method, I just tried it in a fresh Windows Server and Windows 11 VM and both worked fine, can you install PowerShell 7? PowerShell 5.1 is as-is support, PowerShell 7 will work better even if you are only authoring 5.1 scripts.

@JustinGrote
Copy link
Collaborator

JustinGrote commented Oct 5, 2024

So I've actually seen multiple reports on this so there might be something, but on my Win11 machine and in a clean environment, WinPS 32, WinPS64, and PS7.4 all load just fine with 1.94 vscode.

@andyleejordan FYI in case you have an idea.

@JustinGrote JustinGrote added Area-Startup and removed Needs: Triage Maintainer attention needed! labels Oct 5, 2024
@JustinGrote
Copy link
Collaborator

Report from jcotton42 on discord
image

@andyleejordan
Copy link
Member

I wonder, is it related to the shell integration path moving? They released that changer sooner than I expected so we're temporarily broken. Working on getting a release out ASAP.

@opmdsm
Copy link
Author

opmdsm commented Oct 8, 2024

Been having the same issue for the past week or so. Seems to only happen when switching the session to PS 5.1. My workaround is to switch the shell by running powershell in my pwsh session, instead of using the PowerShell: Show Session Menu -> Switch to: command.

I will try it, thanks.

@opmdsm
Copy link
Author

opmdsm commented Oct 8, 2024

Thanks for the submission! The most common reason we've been seeing this lately is an antivirus program blocking or halting the execution of the PowerShell extension. Do you have any antivirus programs installed?

Otherwise there's not much we can do without a reproducible method, I just tried it in a fresh Windows Server and Windows 11 VM and both worked fine, can you install PowerShell 7? PowerShell 5.1 is as-is support, PowerShell 7 will work better even if you are only authoring 5.1 scripts.

I have the built in MS Defender, that's all. I tried on other machines and it's working, it's something particular on my machine.

@opmdsm
Copy link
Author

opmdsm commented Oct 8, 2024

Hi,

Anyone knows how can I trigger again that popup/dialog with adding a trust publisher when installing an extension? I mean the very first time when you install a extension from a publisher and you are asked if you trust that publisher. I'm trying to untrust and trust again that publisher maybe it works. For that I uninstalled Visual Studio Code and then removed .vscode folder from user's folder and also Code folder from C:\Users<USER_NAME>\AppData\Roaming. No luck, only initial setup was triggered (choosing theme, etc).

Thanks,
Marius.

@opmdsm
Copy link
Author

opmdsm commented Oct 21, 2024

This is the trust publisher question which never ends when I press A:
"Do you want to run software from this untrusted publisher?
File
C:\Users\MyUserName.vscode\extensions\ms-vscode.powershell-2022.11.0\modules\PowerShellEditorServices\Commands\PowerShellEditorServices.Commands.types.
ps1xml is published by CN=Microsoft Corporation, O=Microsoft Corporation, L=Redmond, S=Washington, C=US and is not trusted on your system. Only run scripts from
trusted publishers.
[V] Never run [D] Do not run [R] Run once [A] Always run [?] Help (default is "D"):"

@alberto-bottacin
Copy link

Hi, I solved the same issue by run this powershell command:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

this will allow to run powershell scripts with the curret user (both on Powershell ISE and Visual Studio Code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants