Hide automatic / command variables
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- powershell, typescript, vscode
- Domain
- developer-experience, devtools
Research direction
Reproduce the issue by launching any script and breaking on the first line, then inspect the debug variables list shown in the report. Trace how the PowerShell extension populates that list and determine how automatic, script, and process variables should be filtered while preserving explicitly referenced variables. Done means a large debugging session shows relevant user variables without the unwanted automatic variables.
Written by the indexing model from the issue text.
Description
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
While using the Powershell extension when debugging larger scripts i am finding that having to scroll through all the automatic / script / process variables to find the specific one i am after is becoming difficult when i have a larger number of script variables.
Is there a way of hiding all of the automatic variables ($_, $Preference, $errors etc) unless they are explicitly referenced in the script?
I have searched to see if it is something other have described but not found a way.
PowerShell Version
Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.26200
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.4.0
InstanceId : 651c3667-fd86-4ed8-b8d6-7768a49de82f
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-GB
CurrentUICulture : en-GB
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
Visual Studio Code Version
1.109.5
072586267e68ece9a47aa43f8c108e0dcbf44622
x64
Extension Version
ms-vscode.powershell@2025.4.0
Steps to Reproduce
Launch any script and break on the very first line.
Your debug variables list will look something like this:
Visuals
No response
Logs
No response
- Dominant language
- TypeScript
- Stars
- 1.9k
- Forks
- 548
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from PowerShell/vscode-powershell
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PowerShell/vscode-powershell#5599 · 3 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/vscode-powershell#5592 · 2 comments · 1 reaction ·
-
agentic-workflows
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PowerShell/vscode-powershell#5583 · 1 comment ·
-
powershell.scriptAnalysis.settingsPath (Description): Warning Message Should Provide A Workaround OpenArea-Code Formatting Issue-Enhancement
Difficulty 1/5 Under an hour Newbie friendliness 68/100
PowerShell/vscode-powershell#4653 · 3 comments · 4 reactions ·
-
agentic-workflows
Difficulty 3/5 1-2 days Newbie friendliness 48/100
PowerShell/vscode-powershell#5606 ·
All issues in PowerShell/vscode-powershell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
ontola/atomic-server#1625 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
melgarafael/DeskcommCRM#1451 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
bug via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bot:ai-assisted component:compact-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
midnightntwrk/midnight-sdk#403 ·