-
Notifications
You must be signed in to change notification settings - Fork 511
Cannot activate extension #4169
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
Comments
Hi, Could you please provide more logging and environment information by following these steps? Thanks! Regarding shell integration, that is not yet supported in the extension, but it's on our upcoming list. |
The screenshot you've provided indicates that enough of the extension has started that you should be able to get much of those logs we're looking for, specifically the ones from PowerShell Editor Services. |
Came out this time, hope it's useful. |
It is always in the process of activation. It was not like this a few weeks ago. It happened suddenly. |
This is another bug of win11. The last time vs2022 had a similar fault. The problem has been solved by updating to 22622.598. Thank you for your answer. |
I'm sorry to say that it only works once after the update. When I turn off the computer and turn it on again, it returns to the problem mentioned earlier. |
I found a rule. At present, the normal startup of the extension must meet this condition:
In other words, the common operations listed below will cause the extension exception:
The situation is somewhat complicated. I am not sure whether it is an extension problem, a vscode problem or an operating system problem. |
Locked problem cause:
Based on this, please check what problems the Internet has brought. I don't have relevant knowledge and can do nothing about it, so please. |
Hey @memory-yiyi, what are the contents of your PowerShell profiles? It seems like you have something running in your profile that's causing it to hang. |
I have not modified the configuration file. I always use the default configuration. Through your reminder, we are checking whether it is due to module update. It may be caused by the module of SQL Server. After all, there will be no problem if the network is not connected |
I think this may be the problem of module update. |
Hey you know, it doesn't auto-update modules but it does try to query GitHub to see if PowerShell needs an update. I don't know if that's causing your issue, but you can try disabling it with the setting |
You know, I have executed Fresh Start. |
😬 I just saw this, and looked at your log. Found something very interesting. First off, your log indicates you're starting PowerShell 7, installed from the Windows store, that should be fine, except then I see your PSModulePath is this:
So you have PowerShell 7 (which is PowerShell Core) for some reason loading modules from PowerShell 5.1 (which is Windows PowerShell). Can you describe to me how you're starting VS Code, is it perhaps from a PowerShell prompt, like typing in In a nutshell, as we determined in the issue I just linked, if the PSModulePath environment variable is already set and contains Windows PowerShell module paths, and then PowerShell Core is started by the extension, things just won't work since the new instance of PowerShell Core has incorrect PSModulePath settings. |
Or, @memory-yiyi have you manually set |
You know it's impossible.
It is worth noting this paragraph:
These are automatically configured (we will not talk about another one after vscode). But they came last, As you know, the priority of environment variables is higher than that of the following ones. If vscode places them behind, the module of powershell5 will be imported first, which is why the |
@SeeminglyScience thinks we should try ruling something else out. Can you try using a version of PowerShell 7 installed not through the Windows Store? The simplest thing to do would be to grab a zip from the PowerShell releases, extract it, and then add a new additional exe in the VS Code settings to point there and try starting a session with that PowerShell. |
I have reinstalled the system. At present, I use the winget command to install |
Let us know! |
@bryanlavalley-mil you've got |
I think the configuration of |
I sure did. Not sure when or how that was checked. I removed and update extension to 2022.10.0 and it still loads. Thanks! |
Ok @memory-yiyi I'm going to mark this as resolved as I think we narrowed the problem down to the Windows Store installation. Let me know if you're still having an issue! |
OK, thank you for your help. |
Prerequisites
Summary
PowerShell extension is always in "activating state", shell integration cannot be activated.

PowerShell Version
Visual Studio Code Version
Extension Version
[email protected]
Steps to Reproduce
Visuals
Logs
No response
The text was updated successfully, but these errors were encountered: