vscode-powershell: Cannot activate extension

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

PowerShell extension is always in “activating state”, shell integration cannot be activated. image

PowerShell Version

Name                           Value
----                           -----
PSVersion                      7.2.6
PSEdition                      Core
GitCommitId                    7.2.6
OS                             Microsoft Windows 10.0.22622
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.71.0
784b0177c56c607789f9638da7b6bf3230d47a8c
x64

Extension Version

ms-vscode.powershell@2022.8.5

Steps to Reproduce

  1. Open a PS1 file
  2. Waiting for extension activation
  3. After a long time, it is still activated

Visuals

image

Logs

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 28 (10 by maintainers)

Most upvoted comments

I have reinstalled the system. At present, I use the winget command to install pwsh. I installed it at the system level. The expansion can be used normally, but the problem may still exist.

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 found a rule. At present, the normal startup of the extension must meet this condition:

  • After turning on the computer, the first application to be opened must be a vscode extension to start normally.

In other words, the common operations listed below will cause the extension exception:

  1. After starting up, open other desktop applications, and then start vscode.
  2. Restart vscode.

The situation is somewhat complicated. I am not sure whether it is an extension problem, a vscode problem or an operating system problem.

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.