Challenge - 5 Problems
Process Management Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this PowerShell command?
Consider the following command run on a system with multiple running processes named 'notepad':
What will this command output?
Get-Process -Name notepad | Select-Object -First 1 | Format-Table -Property Id, ProcessName -HideTableHeadersWhat will this command output?
PowerShell
Get-Process -Name notepad | Select-Object -First 1 | Format-Table -Property Id, ProcessName -HideTableHeadersAttempts:
2 left
💡 Hint
Think about how Select-Object and Format-Table work together and what -HideTableHeaders does.
✗ Incorrect
The command gets all 'notepad' processes, selects only the first one, then formats the output to show only Id and ProcessName without headers. It does not throw an error.
📝 Syntax
intermediate1:30remaining
Which command correctly stops all running 'calc' processes?
You want to stop all processes named 'calc' using PowerShell. Which of the following commands will do this correctly?
Attempts:
2 left
💡 Hint
Check the parameter names for Stop-Process.
✗ Incorrect
The correct parameter to specify process by name is '-Name'. Option D uses it correctly. Option D misses the parameter name, C uses a wrong parameter name, and D expects a numeric Id, not a name.
🔧 Debug
advanced2:00remaining
Why does this script fail to stop the process?
You run this script to stop a process named 'example':
But it throws an error. What is the cause?
$proc = Get-Process example
Stop-Process $procBut it throws an error. What is the cause?
Attempts:
2 left
💡 Hint
Check what type of input Stop-Process accepts.
✗ Incorrect
Stop-Process does not accept a process object directly. It requires either the process Id or the process name as a string or integer. Passing the object causes an error.
🚀 Application
advanced2:30remaining
How to safely stop a process only if it is running?
You want to stop a process named 'myapp' only if it is currently running, without causing errors if it is not. Which script snippet achieves this?
Attempts:
2 left
💡 Hint
Think about checking existence before stopping.
✗ Incorrect
Option C checks if the process exists and only then stops it, avoiding errors. Option C tries to stop without checking, but errors are silenced (may hide issues). Option C pipes objects which Stop-Process accepts, so it is valid. Option C forces stop but does not check existence.
🧠 Conceptual
expert1:30remaining
What is the effect of using Stop-Process with the -Force parameter?
In PowerShell, what does the -Force parameter do when used with Stop-Process?
Attempts:
2 left
💡 Hint
Consider what 'force' usually means in commands.
✗ Incorrect
The -Force parameter forces the process to stop immediately, bypassing any prompts or protections. It does not delay or log without stopping.