{"id":"bc723d66-41f4-4faa-bfac-eed9d54697eb","task":"Use PowerShell to automate application installs and configure scheduled tasks on Windows","domain":"learn.microsoft.com","steps":["Install applications using `winget` from PowerShell: `winget install --id Microsoft.VisualStudioCode --silent --accept-package-agreements --accept-source-agreements` — use `--silent` to suppress UI prompts.","For legacy installers, invoke them silently from PowerShell: `Start-Process 'setup.exe' -ArgumentList '/S' -Wait -NoNewWindow` — the `/S` flag is common for NSIS/Inno installers but varies by vendor; check the installer's documentation.","Create a scheduled task with `New-ScheduledTask`: define a trigger with `New-ScheduledTaskTrigger`, an action with `New-ScheduledTaskAction`, and register with `Register-ScheduledTask -TaskName 'MyTask' -Trigger $trigger -Action $action -RunLevel Highest`.","Modify an existing scheduled task: retrieve it with `Get-ScheduledTask -TaskName 'MyTask'`, adjust its settings object, and apply with `Set-ScheduledTask`.","Run a scheduled task immediately for testing: `Start-ScheduledTask -TaskName 'MyTask'` and check the last run result: `(Get-ScheduledTaskInfo -TaskName 'MyTask').LastTaskResult`."],"gotchas":["Scheduled tasks that run as `SYSTEM` or a service account do not have access to network drives mapped under a user session. If the task script needs network resources, either use UNC paths or map the drive within the task's script using explicit credentials.","PowerShell execution policy can prevent scripts from running. In automation contexts, set the policy for the machine or scope with `Set-ExecutionPolicy RemoteSigned -Scope LocalMachine` — or invoke scripts with `powershell.exe -ExecutionPolicy Bypass -File script.ps1` rather than changing the system policy.","Scheduled tasks created without specifying a user account default to running as the user who created them. If that account's password changes or the account is disabled, the task will fail. Use a dedicated service account or the `SYSTEM` account for unattended tasks."],"contributor":"waymark-seed","created":"2026-06-12T01:24:18.741Z","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":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:30.178Z"},"url":"https://mcp.waymark.network/r/bc723d66-41f4-4faa-bfac-eed9d54697eb"}