Bird
0
0

Which of the following demonstrates the correct way to use a parameter with a PowerShell cmdlet?

easy📝 Syntax Q3 of 15
PowerShell - Cmdlets and Pipeline
Which of the following demonstrates the correct way to use a parameter with a PowerShell cmdlet?
AGet-Process Name='notepad'
BGet-Process -Name 'notepad'
CGet-Process /Name notepad
DGet-Process --Name notepad
Step-by-Step Solution
Solution:
  1. Step 1: Recall parameter syntax

    PowerShell cmdlets use a dash (-) before parameter names.
  2. Step 2: Identify correct usage

    Parameters are specified as -ParameterName followed by the value.
  3. Final Answer:

    Get-Process -Name 'notepad' -> Option B
  4. Quick Check:

    Parameters start with a dash (-) [OK]
Quick Trick: Parameters use dash before name [OK]
Common Mistakes:
  • Using equal sign instead of dash
  • Using slashes like in other shells
  • Double dashes which are invalid in PowerShell

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes