PSItem
suggest changeContains 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 the same automatic variable and can be used interchangeably, but $_ is by far the most commonly used. The $PSItem name was added in Windows PowerShell 3.0.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents