Bird
0
0

What is the output of this PowerShell command?

medium📝 Command Output Q13 of 15
PowerShell - Cmdlets and Pipeline
What is the output of this PowerShell command?
Get-Process | Where-Object { $_.CPU -gt 100 } | Select-Object -First 1 -Property ProcessName
AThe name of the first process with CPU usage greater than 100
BA list of all processes with CPU usage less than 100
CAn error because of incorrect pipeline usage
DThe total CPU usage of all processes
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the pipeline commands

    Get-Process gets all processes, Where-Object { $_.CPU -gt 100 } filters those with CPU > 100.
  2. Step 2: Understand the selection

    Select-Object -First 1 -Property ProcessName picks the first such process and shows its name.
  3. Final Answer:

    The name of the first process with CPU usage greater than 100 -> Option A
  4. Quick Check:

    Pipeline filters then selects first matching process name [OK]
Quick Trick: Filter with Where-Object, then select first with Select-Object [OK]
Common Mistakes:
  • Confusing CPU greater than with less than
  • Expecting a list instead of one item
  • Thinking pipeline causes errors here

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes