Search notes:

PowerShell: the automatic variable $psItem ($_)

$_ is an alias for $psItem.
The following two pipelines are equivalent:
'foo', 'bar', 'baz' | forEach-object { write-host $_      }
'foo', 'bar', 'baz' | forEach-object { write-host $psItem }
Github repository about-PowerShell, path: /language/variable/automatic/psItem/equivalency.ps1
In a pipeline, $_ refers to the object that is received from the last step in the pipeline.
In a catch block, $_ refers to the exception object (whose type is System.Management.Automation.ErrorRecord) that caused the catch block to be invoked.
In a switch statement, $_ is an alias for the object being tested.

See also

Other automatic variables

Index