Bird
0
0

What will be the output of this command?

medium📝 Command Output Q5 of 15
PowerShell - Cmdlets and Pipeline
What will be the output of this command?
Get-Process | Where-Object { $_.Handles -gt 1000 } | Select-Object -First 1 | Select-Object -ExpandProperty Name
AThe name of the first process with more than 1000 handles
BAll processes with more than 1000 handles
CAn error because of wrong syntax
DNo output because no process has more than 1000 handles
Step-by-Step Solution
Solution:
  1. Step 1: Filter processes with Handles greater than 1000

    The command filters processes where the Handles property is greater than 1000.
  2. Step 2: Select the first such process and output its Name

    Select-Object -First 1 picks the first matching process, and -ExpandProperty Name outputs just the process name.
  3. Final Answer:

    The name of the first process with more than 1000 handles -> Option A
  4. Quick Check:

    Filter then select first name = C [OK]
Quick Trick: Use Select-Object -ExpandProperty to get property value directly [OK]
Common Mistakes:
  • Expecting all processes instead of first
  • Thinking it causes syntax error
  • Assuming no process has >1000 handles

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes