diecknet

Run PowerShell Script with Windows Task Scheduler

The parameter I keep forgetting is '-file'
2021-10-13
1 minute
A screenshot showing the Action Configuration of a Windows Scheduled Task - to run a PowerShell script.

More ore less quick note for myself - on how to run a PowerShell Script using Windows Task Scheduler.

Open Task Scheduler

A quick way to open Task Scheduler: WIN + R, then run taskschd.msc.

Create New Task

Open “Task Scheduler Library” → “Create New Task”. Set all the self-explanatory options like Name, Description, User Account, Triggers, etc.

Set Action

SettingValue
ActionStart a program
Program/scriptpowershell.exe
Add arguments (optional)-file "C:\Path\Script.ps1"