PowerShell Automatic Variables $_ / $PSItem


Example

Contains the object/item currently being processed by the pipeline.

PS C:\> 1..5 | % { Write-Host "The current item is $_" }
The current item is 1
The current item is 2
The current item is 3
The current item is 4
The current item is 5

$PSItem and $_ are identical and can be used interchangeably, but $_ is by far the most commonly used.