Bird
0
0

Which of the following is the correct syntax to stop a process named 'notepad' in PowerShell?

easy📝 Syntax Q12 of 15
PowerShell - System Administration
Which of the following is the correct syntax to stop a process named 'notepad' in PowerShell?
AStop-Process notepad -Force
BGet-Process -Stop notepad
CKill-Process -Name notepad
DStop-Process -Name notepad
Step-by-Step Solution
Solution:
  1. Step 1: Identify correct cmdlet and parameter

    The cmdlet to stop a process is Stop-Process. The parameter to specify process by name is -Name.
  2. Step 2: Validate syntax correctness

    Stop-Process -Name notepad uses correct cmdlet and parameter: Stop-Process -Name notepad. Get-Process -Stop notepad uses wrong cmdlet and parameter. Stop-Process notepad -Force misses the parameter name before 'notepad'. Kill-Process -Name notepad uses a non-existent cmdlet.
  3. Final Answer:

    Stop-Process -Name notepad -> Option D
  4. Quick Check:

    Stop-Process with -Name is correct syntax = C [OK]
Quick Trick: Use Stop-Process with -Name to stop by process name [OK]
Common Mistakes:
  • Omitting the -Name parameter
  • Using incorrect cmdlet names like Kill-Process
  • Placing process name without parameter name

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PowerShell Quizzes