Challenge - 5 Problems
Scheduled Task 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 this command that lists scheduled tasks with a specific name filter. What output will it produce?
PowerShell
Get-ScheduledTask -TaskName "Backup*" | Select-Object -ExpandProperty TaskNameAttempts:
2 left
💡 Hint
Think about how Select-Object -ExpandProperty outputs values in PowerShell.
✗ Incorrect
The command lists scheduled tasks whose names start with 'Backup'. Select-Object -ExpandProperty outputs the property values as strings, each on a new line.
📝 Syntax
intermediate2:00remaining
Which option correctly creates a scheduled task to run Notepad daily at 9 AM?
Select the PowerShell command that correctly creates a scheduled task named 'OpenNotepad' to run Notepad.exe every day at 9 AM.
Attempts:
2 left
💡 Hint
Check the parameter names and formats for Register-ScheduledTask and New-ScheduledTaskTrigger.
✗ Incorrect
Option B uses the correct parameter names and formats. 'TaskName' is the correct parameter for Register-ScheduledTask. The time format '9am' is valid. Option B uses '-Name' which is invalid. Option B uses New-ScheduledTask which only creates a task object but does not register it. Option B uses quoted time with ':' which is valid for -At parameter.
🔧 Debug
advanced2:00remaining
Why does this scheduled task creation script fail?
This script is intended to create a scheduled task that runs a script daily at 7 PM. Why does it fail?
PowerShell
Register-ScheduledTask -TaskName "RunScript" -Trigger (New-ScheduledTaskTrigger -Daily -At "19:00") -Action (New-ScheduledTaskAction -Execute "powershell.exe" -Argument "-File C:\Scripts\daily.ps1")
Attempts:
2 left
💡 Hint
Check the format expected by the -At parameter in New-ScheduledTaskTrigger.
✗ Incorrect
The -At parameter expects a DateTime or TimeSpan object or a parsable time string. Unquoted time containing ':' causes a parser error.
🚀 Application
advanced2:00remaining
How to disable a scheduled task using PowerShell?
You want to disable a scheduled task named 'DataSync'. Which command will do this correctly?
Attempts:
2 left
💡 Hint
Disabling a task means it won't run but still exists.
✗ Incorrect
Disable-ScheduledTask disables the task so it won't run. Set-ScheduledTask does not have an -Enabled parameter. Stop-ScheduledTask stops a running task but does not disable it. Remove-ScheduledTask deletes the task.
🧠 Conceptual
expert3:00remaining
What is the effect of this PowerShell snippet on scheduled tasks?
What does this script do?
$tasks = Get-ScheduledTask | Where-Object { $_.State -eq 'Ready' -and $_.TaskName -like '*Backup*' }
foreach ($task in $tasks) { Disable-ScheduledTask -TaskName $task.TaskName }
Attempts:
2 left
💡 Hint
Look at the filtering and the command inside the loop.
✗ Incorrect
The script filters tasks whose state is 'Ready' and name contains 'Backup'. It then disables each of those tasks, preventing them from running until re-enabled.