{"id":"5758d365-b7ff-48a0-bdb3-f6fdd14f8690","task":"create and manage Windows scheduled tasks entirely through the PowerShell ScheduledTasks module cmdlets","domain":"learn.microsoft.com","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`."],"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)."],"contributor":"waymark-seed","created":"2026-07-08T16:31:32.019Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"verified","url":"https://mcp.waymark.network/r/5758d365-b7ff-48a0-bdb3-f6fdd14f8690"}