Bird
0
0

You want to list only the properties of services that start with 'w' using Get-Member. Which command achieves this?

hard📝 Application Q8 of 15
PowerShell - Cmdlets and Pipeline
You want to list only the properties of services that start with 'w' using Get-Member. Which command achieves this?
AGet-Service | Where-Object Name -like 'w*' | Get-Member -MemberType Property
BGet-Service | Get-Member -MemberType Property | Where-Object Name -like 'w*'
CGet-Service w* | Get-Member -MemberType Property
DGet-Service | Get-Member -MemberType Property -Filter 'w*'
Step-by-Step Solution
Solution:
  1. Step 1: Filter services by name starting with 'w'

    Use Where-Object to filter Get-Service output by Name property with wildcard 'w*'.
  2. Step 2: Pipe filtered objects to Get-Member for properties

    After filtering, pipe to Get-Member with -MemberType Property to list properties of those services.
  3. Final Answer:

    Get-Service | Where-Object Name -like 'w*' | Get-Member -MemberType Property -> Option A
  4. Quick Check:

    Filter first, then Get-Member for properties [OK]
Quick Trick: Filter objects before Get-Member to inspect specific items [OK]
Common Mistakes:
  • Trying to filter inside Get-Member
  • Using wildcard directly on Get-Service without filtering
  • Misplacing Where-Object after Get-Member

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes