Bird
0
0

Which of the following is the correct syntax to group processes by their ProcessName property?

easy📝 Syntax Q12 of 15
PowerShell - Working with Objects
Which of the following is the correct syntax to group processes by their ProcessName property?
AGet-Process | Group-Object -Property ProcessName
BGet-Process | Group-Object -ProcessName
CGet-Process | Group-Object -Name ProcessName
DGet-Process | Group-Object /Property ProcessName
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter for grouping property

    The correct parameter is '-Property' to specify the property to group by.
  2. Step 2: Check syntax correctness

    Get-Process | Group-Object -Property ProcessName uses the correct syntax: 'Group-Object -Property ProcessName'. Options A and C use wrong parameter names; D uses invalid syntax.
  3. Final Answer:

    Get-Process | Group-Object -Property ProcessName -> Option A
  4. Quick Check:

    Use '-Property' to specify grouping property [OK]
Quick Trick: Use '-Property' to specify grouping key in Group-Object [OK]
Common Mistakes:
  • Omitting the dash before 'Property'
  • Using '-Name' instead of '-Property'
  • Using invalid syntax like slashes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes