Bird
0
0

You run this command but get an error:

medium📝 Debug Q14 of 15
PowerShell - System Administration
You run this command but get an error:
Stop-Process -Name

What is the problem and how to fix it?
AThe command should be Get-Process -Name instead
BStop-Process does not use -Name; use -Id instead
CMissing process name after -Name; add the process name
DStop-Process requires -Force parameter always
Step-by-Step Solution
Solution:
  1. Step 1: Identify the error cause

    The command uses -Name parameter but does not specify the process name, causing a syntax error.
  2. Step 2: Correct the command

    To fix, provide the process name after -Name, for example: Stop-Process -Name notepad.
  3. Final Answer:

    Missing process name after -Name; add the process name -> Option C
  4. Quick Check:

    Parameter -Name needs a value = D [OK]
Quick Trick: Always provide a value after -Name parameter [OK]
Common Mistakes:
  • Leaving -Name without a value
  • Assuming -Force is always required
  • Confusing Stop-Process with Get-Process

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes