PowerShell Genie

What does $_ mean inside a PowerShell pipeline?

Question 1 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

$_ is the current pipeline object inside contexts such as Where-Object and ForEach-Object.

Interview · Question 3 of 34

Answer before reveal

Your draft

Write the answer you would give in an interview. The model answer stays hidden until you have drafted at least a short response.

Primary documentation

Where-Object reference · Get-Service reference

Continue
Genie guideWhat does $_ mean inside a PowerShell pipeline?

$_ is the current pipeline object inside contexts such as Where-Object and ForEach-Object.