Bird
0
0

What will be the output of this command?

medium📝 Command Output Q4 of 15
PowerShell - Cmdlets and Pipeline
What will be the output of this command?
Get-Process | Where-Object { $_.Handles -gt 1000 } | Select-Object -First 3
AAll processes with handles less than 1000
BThe first 3 processes with more than 1000 handles
CAn error because Select-Object cannot be piped
DThe last 3 processes with more than 1000 handles
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the pipeline commands

    Get-Process outputs all processes, Where-Object filters those with handles > 1000, then Select-Object -First 3 picks the first 3.
  2. Step 2: Understand output behavior

    The pipeline passes filtered results to Select-Object, which returns the first 3 matching processes.
  3. Final Answer:

    The first 3 processes with more than 1000 handles -> Option B
  4. Quick Check:

    Pipeline filters then selects first 3 [OK]
Quick Trick: Select-Object -First picks top items after filtering [OK]
Common Mistakes:
  • Confusing first with last
  • Thinking Select-Object cannot be piped
  • Misreading filter condition

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes