Get-ScheduledTask
Use Get-ScheduledTask to list scheduled tasks with their definitions, triggers and current state.
Documentation: Microsoft Learn — PowerShell module reference
Syntax
See the command anatomy
Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.
Get-ScheduledTask [[-TaskName] <string[]>] [-TaskPath <String[]>] [-CimSession <CimSession[]>] [<CommonParameters>]- Stage 1Get-ScheduledTask
-TaskName -TaskPath -CimSession
Try it
PowerShell example · browser support is limited.
Execution scope: The full example below requires PowerShell outside this browser. You can edit this runner to use the supported practice commands; unsupported syntax returns an explanation.
Follow the objects
Run the command to inspect each stage.
Examples
Get-ScheduledTask -TaskPath \
Show reference output
Sample output · fictional data, shaped like the real thing
TaskName State ----------- -------- Backup Ready Maintenance Disabled
Filter by State
Show reference output
Sample output · fictional data, shaped like the real thing
TaskName TaskPath ----------- ------------------- Maintenance \Microsoft\Windows\
Get-ScheduledTask -TaskName MyTask
Show reference output
Sample output · fictional data, shaped like the real thing
PowerShell.exe -File C:\Scripts\Backup.ps1 maintenance.exe
Parameters
Parameter definitions:
-TaskName-TaskPath-CimSession
Practical use and troubleshooting
Practical scenario: Use Get-ScheduledTask when you need to list scheduled tasks with their definitions, triggers and current state. Start with one identified target and inspect the returned values before extending the operation to a list. Keep the identity in your report so you can trace each result back to the object or path that produced it.
Common error and fix: A task-not-found error can mean the task is stored under another TaskPath. Inspect both TaskName and TaskPath and target the exact registered task. In an unattended script, capture this failure with its original error record and record which target failed. An empty result and an unsuccessful query must remain distinguishable in the final report.
See also: Get-ScheduledTaskInfo. Get-ScheduledTask returns task configuration; Get-ScheduledTaskInfo returns runtime information such as LastRunTime and LastTaskResult. An enabled task definition is not evidence of a successful last run. Read the linked command before substituting it; similar names do not imply identical inputs or output.
Recap
Get-ScheduledTask Use Get-ScheduledTask to list scheduled tasks with their definitions, triggers and current state.
Next: Get-Job