Repository navigation
Closed
Labels
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
The variable $SplatProcessss has a typo. It is also used for splatting later in the code
$SplatProcessss = @{
FilePath = 'C:\Windows\system32\cmd.exe'
}
Start-Process @SplatProcessss
Pressing F2 to rename the variable to SplatProcess results in changing the splatting variable to $SplatProcess instead of @SplatProcess
$SplatProcess = @{
FilePath = 'C:\Windows\system32\cmd.exe'
}
Start-Process $SplatProcess <--- wrong
Expected result renaming the variable
$SplatProcess = @{
FilePath = 'C:\Windows\system32\cmd.exe'
}
Start-Process @SplatProcess <--- correct
Thank you for the great feature
PowerShell Version
PS C:\> $PSVersionTable; $Host
Name Value
---- -----
PSVersion 5.1.26100.8655
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.26100.8655
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Name : Visual Studio Code Host
Version : 2026.1.1
InstanceId : 9c176ed1-2a2d-4562-b60e-cf1e6c8f9775
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : de-CH
CurrentUICulture : de-DE
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspaceVisual Studio Code Version
PS C:\> code --version
1.125.1
fcf604774b9f2674b473065736ee75077e256353
x64Extension Version
PS C:\> code --list-extensions --show-versions | Select-String powershell
ms-vscode.powershell@2026.1.1Steps to Reproduce
See summary
Visuals
No response
Logs
No response
Reacted by github-actions and Copilot
Activity
github-actions commentedon Jun 23, 2026
Rename (
textDocument/rename) drops the@splat sigil when renaming a splatted variable — genuine, actionable bug.For maintainers
Reproducibility
High confidence. The report is self-contained: minimal before/after code snippet, unambiguous expected vs. actual output, and full version details (PS 5.1.26100.8655, VS Code 1.125.1, extension 2026.1.1). No missing information.
Copilot-fix suitability
Maybe. The bug is well-scoped and clearly defined: renaming a variable that is used as a splat argument (
@VarName) incorrectly replaces the@sigil with$. However, the rename edit list is computed by PowerShellEditorServices (thetextDocument/renameLSP handler), not by this extension — the extension only proxies the request. A fix would need to target the PSES repo, making it a poor fit for a Copilot fix here.Likely area
PowerShellEditorServices — the rename handler that produces
WorkspaceEdittext edits. PSES likely uses the variable name without distinguishing$var(assignment/regular reference) from@var(splat) call sites, so the sigil is not preserved. The relevant code is probably insrc/PowerShellEditorServices/Services/TextDocument/Handlers/RenameHandler.csor the rename/refactoring subsystem of PSES.Reproduction steps (inferred)
.ps1file and paste:$SplatProcessss.SplatProcess.@SplatProcessss→$SplatProcess(sigil changed).@SplatProcessss→@SplatProcess(sigil preserved).Related issues
Add this agentic workflows to your repo
To install this agentic workflow, run
JustinGrote commentedon Jun 23, 2026
Thanks Jürg Steiger (@juergsteiger)! Surprised I missed that.
@copilot prepare a test to replicate the behavior and a PR to resolve it.
JustinGrote commentedon Jun 23, 2026
Whoops meant to direct this to PSES