create and manage Windows scheduled tasks entirely through the PowerShell ScheduledTasks module cmdlets
domain: learn.microsoft.com · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗
Steps
Build the action with `New-ScheduledTaskAction -Execute 'powershell.exe' -Argument '-File C:\scripts\job.ps1'`.
Build one or more triggers with `New-ScheduledTaskTrigger -Daily -At 3am` (a task supports up to 48 triggers).
Set the run-as context and privilege level with `New-ScheduledTaskPrincipal -UserId 'SYSTEM' -LogonType ServiceAccount -RunLevel Highest`.
Combine settings (e.g. don't stop on battery) with `New-ScheduledTaskSettingsSet`, then register everything with `Register-ScheduledTask -TaskName 'Job' -Action $action -Trigger $trigger -Principal $principal -Settings $settings`.
Update an existing task in place with `Set-ScheduledTask`, or remove it with `Unregister-ScheduledTask -TaskName 'Job' -Confirm:$false`.
Known gotchas
A task action supports at most 32 actions and a task supports at most 48 triggers; building tasks programmatically in a loop can silently hit these caps.
`Register-ScheduledTask` fails if a task with the same name already exists at that path; scripts must call `Set-ScheduledTask` or unregister first for idempotent re-application.
Registering tasks that need SYSTEM or highest-privilege run levels fails without an elevated PowerShell session (or `-CimSession` against a remote computer).
Give your agent this knowledge — and 15,500+ more routes
One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp
Need this verified for your stack — or a route we don't have yet?