taskscheduler
$
npx mdskill add taracodlabs/aiden/taskschedulerManage Windows Task Scheduler jobs using PowerShell commands
- Schedule scripts or programs to run at specific times or intervals
- Uses PowerShell cmdlets like Get-ScheduledTask, Register-ScheduledTask, and New-ScheduledTaskAction
- Evaluates task state, triggers, and settings to enable, disable, or modify tasks
- Returns task details, execution status, and confirmation of changes
SKILL.md
.github/skills/taskschedulerView on GitHub ↗
---
name: taskscheduler
description: "Windows Task Scheduler: create, list, enable, disable, delete (PS)"
category: windows
version: 1.0.0
platform: windows
tags: taskscheduler, scheduled, task, automation, cron, windows, powershell, trigger
license: Apache-2.0
---
# Task Scheduler
Manage Windows Task Scheduler jobs via PowerShell — create triggers, set actions, enable/disable tasks, and inspect run history. The Windows equivalent of cron.
## When to Use
- User wants to schedule a script or program to run at a specific time or interval
- User asks to list all scheduled tasks or find a specific one
- User wants to enable, disable, or delete a scheduled task
- User needs to check when a task last ran or why it failed
- User wants to create a daily, weekly, or startup-triggered task
## How to Use
### List all non-disabled tasks
```powershell
Get-ScheduledTask | Where-Object State -ne 'Disabled' |
Select-Object TaskName, TaskPath, State |
Sort-Object TaskName | Format-Table -AutoSize
```
### Get task details (last run, next run)
```powershell
Get-ScheduledTaskInfo -TaskName "MyTask"
```
### Create a daily task
```powershell
$action = New-ScheduledTaskAction -Execute "powershell.exe" `
-Argument "-NonInteractive -File C:\scripts\daily-backup.ps1"
$trigger = New-ScheduledTaskTrigger -Daily -At "08:00AM"
$settings = New-ScheduledTaskSettingsSet -ExecutionTimeLimit (New-TimeSpan -Hours 1)
Register-ScheduledTask -TaskName "DailyBackup" `
-Action $action -Trigger $trigger -Settings $settings `
-Description "Daily backup at 8 AM" -RunLevel Limited
```
### Create a task that runs at Windows startup
```powershell
$action = New-ScheduledTaskAction -Execute "powershell.exe" `
-Argument "-File C:\scripts\startup.ps1"
$trigger = New-ScheduledTaskTrigger -AtStartup
Register-ScheduledTask -TaskName "StartupScript" `
-Action $action -Trigger $trigger -RunLevel Limited
```
### Create a task that runs every 30 minutes
```powershell
$action = New-ScheduledTaskAction -Execute "python.exe" `
-Argument "C:\scripts\monitor.py"
$trigger = New-ScheduledTaskTrigger -RepetitionInterval (New-TimeSpan -Minutes 30) -Once -At (Get-Date)
Register-ScheduledTask -TaskName "MonitorEvery30m" `
-Action $action -Trigger $trigger -RunLevel Limited
```
### Enable or disable a task
```powershell
Enable-ScheduledTask -TaskName "DailyBackup"
Disable-ScheduledTask -TaskName "DailyBackup"
```
### Run a task immediately
```powershell
Start-ScheduledTask -TaskName "DailyBackup"
```
### Delete a task
```powershell
Unregister-ScheduledTask -TaskName "DailyBackup" -Confirm:$false
```
### View task run history
```powershell
Get-WinEvent -LogName "Microsoft-Windows-TaskScheduler/Operational" |
Where-Object { $_.Message -match "DailyBackup" } |
Select-Object TimeCreated, Message |
Select-Object -First 10
```
## Examples
**"Schedule a Python script to run every day at 9 AM"**
→ `New-ScheduledTaskAction` with `python.exe` + script path, `New-ScheduledTaskTrigger -Daily -At "09:00AM"`, then `Register-ScheduledTask`.
**"List all tasks that are currently ready to run"**
→ `Get-ScheduledTask | Where-Object State -eq 'Ready' | Select-Object TaskName, TaskPath`
**"When did my backup task last run and did it succeed?"**
→ `Get-ScheduledTaskInfo -TaskName "DailyBackup" | Select-Object LastRunTime, LastTaskResult` (0 = success)
## Cautions
- Tasks registered with `-RunLevel Limited` run as the current user without UAC prompt — preferred for most automation
- `-RunLevel Highest` requires the task to be created in an elevated session; it will not prompt the user during execution
- `LastTaskResult` of 0 means success; any other value is an error code
- Task Scheduler event log must be enabled to use `Get-WinEvent` history queries
More from taracodlabs/aiden
- ade-footerInstalled skill — add instructions here
- archon-bridgeUnified portfolio + order routing across Zerodha, Upstox, Angel One
- censysCensys lookups: hosts, certificates, services on the public internet
- clipboard-historyRead/write Windows clipboard text, HTML, images, history (PowerShell)
- code_executionRunning scripts and code on Windows
- create_txt_fileCreates a text file with specified content at a given path
- crt.shEnumerate subdomains and TLS certs via CT logs (no API key needed)
- currently_running_processesShow me my currently running processes.
- cveapiCVE lookup via MITRE + NVD: severity, CVSS, affected products, refs
- decrease_volume_littleDecreases the system volume by a small amount.