Bird
0
0

Which of the following is the correct syntax to list all processes and then sort them by CPU usage using the pipeline?

easy📝 Syntax Q12 of 15
PowerShell - Cmdlets and Pipeline
Which of the following is the correct syntax to list all processes and then sort them by CPU usage using the pipeline?
AGet-Process Sort CPU
BGet-Process | Sort-Object CPU
CGet-Process | Sort-Object -CPU
DGet-Process Sort-Object CPU
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct pipeline usage

    The pipeline operator | must connect commands properly; Get-Process | Sort-Object CPU uses it correctly.
  2. Step 2: Check Sort-Object parameters

    Sorting by property CPU is done with Sort-Object CPU, which Get-Process | Sort-Object CPU uses correctly.
  3. Final Answer:

    Get-Process | Sort-Object CPU -> Option B
  4. Quick Check:

    Correct pipeline and sorting syntax = Get-Process | Sort-Object CPU [OK]
Quick Trick: Use | between commands and correct parameter names [OK]
Common Mistakes:
  • Omitting the pipeline operator
  • Using wrong parameter syntax like -CPU
  • Using non-existent commands like Sort CPU

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes