vscode-powershell
vscode-powershell copied to clipboard
extensionHost running dozens of pwsh -c "Get-Command -All"
Prerequisites
- [x] I have written a descriptive issue title.
- [x] I have searched all open and closed issues to ensure it has not already been reported.
- [x] I have read the troubleshooting guide.
- [x] I am sure this issue is with the extension itself and does not reproduce in a standalone PowerShell instance.
- [x] 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
There are often well over 15 extensionHost processes running pwsh -c "Get-Command -All" which lags out my system, each one taking 5-10% CPU.
PowerShell Version
Name Value
---- -----
PSVersion 7.5.0
PSEdition Core
GitCommitId 7.5.0
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Name : Visual Studio Code Host
Version : 2025.0.0
InstanceId : e708609b-6fff-4686-b3c4-3dcb1d390b8f
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
1.99.0
4437686ffebaf200fa4a6e6e67f735f3edf24ada
x64
Extension Version
[email protected]
Steps to Reproduce
Open VS Code Open ps1 file Start typing
Visuals
No response
Logs
Of course I am unable to reproduce after enabling trace logging.
Thanks for your submission!
Do you have the PowerShell Command window enabled? That could be a potential culprit, but there should only ever be one. That particular component is deprecated. I'm unable to reproduce it.
Does this happen with your profile disabled?
I'm also hitting the same issue on MS cloud PC. How do I pull the logs for you?
I'm having the same experience. It does not matter if powershell.enableProfileLoading is enabled or not.
Name Value
---- -----
PSVersion 7.5.2
PSEdition Core
GitCommitId 7.5.2
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
1.102.0-insider
d6b261f44406fdd26e5c0de997fe8e30d7fae5d7
x64
[email protected]
Major Minor Build Revision
----- ----- ----- --------
4 3 0 0
Commands I've noticed running:
pwsh -c "Get-Command -All | Select-Object Name, CommandType, Definition, ModuleName, @{Name=\"Version\";Expression={$_.Version.ToString()}} | ConvertTo-Json"
pwsh -c "Get-Command -CommandType Alias | Select-Object Name, CommandType, Definition, DisplayName, ModuleName, @{Name=\"Version\";Expression={$_.Version.ToString()}} | ConvertTo-Json"
However, it seems that disabling Terminal > Integrated > Suggest: Enable (Preview) prevents the problem from arising.
@andyleejordan I know you did some coordination with the VSCode team on the Suggest stuff (which is not part of this extension), does this ring a bell? I imagine it's to populate the terminal intellisense.
Yeah that does ring a bell. Let's loop in @Tyriar.
Yup, found it: https://github.com/microsoft/vscode/blob/d2b3e0a3d6c0002d83351786adf0abe6e14d16de/extensions/terminal-suggest/src/shell/pwsh.ts#L58
@Tyriar maybe we can transfer this issue to your repo?
This issue has been labeled as resolved, please verify the provided fix (or other reason).
This shouldn't be locking up extension hosts as most of it is async waiting. We also tweaked caching to be much more aggressively recently. FYI @meganrogge
This issue has been labeled as resolved, please verify the provided fix (or other reason).
More info: https://github.com/microsoft/vscode/issues/256746#issuecomment-3102748099
This issue has been labeled as resolved, please verify the provided fix (or other reason).
This issue has been labeled as resolved, please verify the provided fix (or other reason).
Going to mark it here as a dupe of the external issue that has been opened, please track there.