Bird
0
0

Which of the following is the correct syntax to find all commands that start with 'Get-' using Get-Command?

easy📝 Syntax Q12 of 15
PowerShell - Basics and Environment
Which of the following is the correct syntax to find all commands that start with 'Get-' using Get-Command?
AGet-Command "Get-"
BGet-Command -Filter "Get-"
CGet-Command -Name "Get-*"
DGet-Command -Search "Get-*"
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct parameter for name filtering

    The -Name parameter accepts wildcards like "Get-*" to find commands starting with 'Get-'.
  2. Step 2: Check other options for correctness

    -Filter is not a valid parameter for Get-Command, and -Search does not exist. Passing just "Get-" without wildcard won't match all commands starting with 'Get-'.
  3. Final Answer:

    Get-Command -Name "Get-*" -> Option C
  4. Quick Check:

    Use -Name with wildcard = C [OK]
Quick Trick: Use -Name with wildcard pattern to find commands [OK]
Common Mistakes:
  • Using invalid parameters like -Filter or -Search
  • Not using wildcard * to match multiple commands
  • Passing command name without quotes

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes