Special Variable $_

In PowerShell, $_ is a special variable that represents the current object in the pipeline. When several cmdlets are piped together, this special variable may be used often. Several examples of using this special variable are shown later in this chapter.

Note

A special variable named $input also represents objects passed along the pipeline, but we do not look at this variable in any further detail in this chapter.

Note

See Get-Help about_automatic_variables for more information and examples.

Get Microsoft® SQL Server 2008 R2 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.