Bird
0
0

What will be the output of this PowerShell command?

medium📝 Command Output Q13 of 15
PowerShell - Basics and Environment
What will be the output of this PowerShell command?
Get-Process | Where-Object { $_.CPU -gt 100 }
ALists all processes with CPU usage less than 100 seconds
BLists all processes with CPU usage greater than 100 seconds
CShows an error because CPU property does not exist
DLists all processes regardless of CPU usage
Step-by-Step Solution
Solution:
  1. Step 1: Understand Get-Process output

    Get-Process returns process objects with a CPU property showing CPU time in seconds.
  2. Step 2: Analyze Where-Object filter

    The filter $_.CPU -gt 100 selects processes with CPU time greater than 100 seconds.
  3. Final Answer:

    Lists all processes with CPU usage greater than 100 seconds -> Option B
  4. Quick Check:

    Filter CPU > 100 seconds = Lists all processes with CPU usage greater than 100 seconds [OK]
Quick Trick: Where-Object filters objects by property conditions [OK]
Common Mistakes:
  • Confusing greater than (gt) with less than
  • Assuming CPU property is missing
  • Thinking it lists all processes without filtering

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes