Bird
0
0

Which of the following is the correct syntax to select the 'Name' property only from a list of services?

easy📝 Syntax Q3 of 15
PowerShell - Cmdlets and Pipeline
Which of the following is the correct syntax to select the 'Name' property only from a list of services?
AGet-Service | Select-Object -Property Name
BGet-Service | Select-Object Name -Property
CGet-Service | Select-Object -Name Property
DGet-Service | Select-Object Property -Name Name
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter usage

    Select-Object uses '-Property' followed by property names.
  2. Step 2: Check each option's syntax

    Only Get-Service | Select-Object -Property Name correctly uses '-Property Name'. Others misuse parameters.
  3. Final Answer:

    Get-Service | Select-Object -Property Name -> Option A
  4. Quick Check:

    Use -Property before property names [OK]
Quick Trick: Always put -Property before property names [OK]
Common Mistakes:
  • Placing property names before -Property
  • Using invalid parameter names
  • Mixing parameter order incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes