Bird
0
0

Why does this command fail?

medium📝 Debug Q7 of 15
PowerShell - System Administration
Why does this command fail?
Stop-Process -Id 'abc'
AProcess ID must be a number, not a string.
BStop-Process does not accept -Id parameter.
CProcess name should be used instead of ID.
DThe command needs -Name parameter, not -Id.
Step-by-Step Solution
Solution:
  1. Step 1: Understand -Id parameter type

    -Id expects a numeric process ID, not a string.
  2. Step 2: Analyze the command failure

    Using 'abc' (a string) causes a type error because it's not a valid numeric ID.
  3. Final Answer:

    Process ID must be a number, not a string. -> Option A
  4. Quick Check:

    -Id requires numeric value; strings cause errors [OK]
Quick Trick: Use numbers for -Id, names for -Name [OK]
Common Mistakes:
  • Passing strings to -Id
  • Confusing -Id and -Name parameters
  • Assuming Stop-Process lacks -Id

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes