Skip to content

Rename Service Settings (F2 in Preview 2026.1.1) changes splatting variable #2324

Description

@juergsteiger

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.LocalRunspace

Visual Studio Code Version

PS C:\> code --version
1.125.1
fcf604774b9f2674b473065736ee75077e256353
x64

Extension Version

PS C:\> code --list-extensions --show-versions | Select-String powershell

ms-vscode.powershell@2026.1.1

Steps to Reproduce

See summary

Visuals

No response

Logs

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions