Skip to content

Commit 171242d

Browse files
JustinGroteSeeminglyScience
authored andcommitted
Include $PSItem in auto variables in addition to $_
While it would be nice to only present `$PSItem` to encourage people to use it, that may confuse people who still use `$_` and don't know that they are the same. Co-authored-by: Patrick Meinecke <SeeminglyScience@users.noreply.github.com>
1 parent 321950d commit 171242d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PowerShellEditorServices/Services/DebugAdapter/DebugService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,7 +756,7 @@ private bool AddToAutoVariables(PSObject psvariable, string scope)
756756
// Some local variables, if they exist, should be displayed by default
757757
if (psvariable.TypeNames[0].EndsWith("LocalVariable"))
758758
{
759-
if (variableName.Equals("_"))
759+
if (variableName.Equals("PSItem") || variableName.Equals("_"))
760760
{
761761
return true;
762762
}

0 commit comments

Comments
 (0)