Bird
0
0

How can you combine cmdlets to find processes using more than 50 CPU seconds and sort them by memory usage?

hard📝 Application Q9 of 15
PowerShell - Cmdlets and Pipeline
How can you combine cmdlets to find processes using more than 50 CPU seconds and sort them by memory usage?
AGet-Process | Where CPU > 50 | Sort Memory
BGet-Process -CPU > 50 | Sort-Object Memory
CGet-Process | Filter-Object CPU > 50 | Order-Object Memory
DGet-Process | Where-Object { $_.CPU -gt 50 } | Sort-Object WorkingSet
Step-by-Step Solution
Solution:
  1. Step 1: Filter processes by CPU usage

    Use Where-Object with a script block to select processes with CPU > 50.
  2. Step 2: Sort filtered processes by memory usage

    Sort-Object WorkingSet sorts by memory (WorkingSet is memory property).
  3. Final Answer:

    Get-Process | Where-Object { $_.CPU -gt 50 } | Sort-Object WorkingSet -> Option D
  4. Quick Check:

    Use Where-Object and Sort-Object with correct syntax [OK]
Quick Trick: Use Where-Object to filter and Sort-Object to order [OK]
Common Mistakes:
  • Using invalid cmdlets like Filter-Object
  • Incorrect parameter syntax
  • Omitting script block braces

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes