Bird
0
0

What does the following PowerShell command return?

medium📝 Command Output Q4 of 15
PowerShell - Cmdlets and Pipeline
What does the following PowerShell command return?
Get-Service | Where-Object { $_.Status -eq 'Stopped' }
AA list of all services that are running
BA list of all services that are currently stopped
CAn error because of incorrect syntax
DAll services regardless of status
Step-by-Step Solution
Solution:
  1. Step 1: Understand Get-Service

    This cmdlet retrieves all services on the system.
  2. Step 2: Analyze Where-Object filter

    The filter selects services where the Status property equals 'Stopped'.
  3. Final Answer:

    A list of all services that are currently stopped -> Option B
  4. Quick Check:

    Where-Object filters based on property values [OK]
Quick Trick: Where-Object filters output by condition [OK]
Common Mistakes:
  • Confusing 'Stopped' with 'Running'
  • Assuming syntax error due to braces
  • Thinking it returns all services

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes