07-21-2023, 06:07 PM
In case you want to run a PowerShell script with Windows Task Scheduler, please follow the steps below:
1. Create a task
2. Set `Program/Script` to `Powershell.exe`
3. Set `Arguments` to `-File "C:\xxx.ps1"`
It's from another answer, *https://stackoverflow.com/questions/23953926/how-to-execute-a-powershell-script-automatically-using-windows-task-scheduler/23954618#23954618*.
1. Create a task
2. Set `Program/Script` to `Powershell.exe`
3. Set `Arguments` to `-File "C:\xxx.ps1"`
It's from another answer, *https://stackoverflow.com/questions/23953926/how-to-execute-a-powershell-script-automatically-using-windows-task-scheduler/23954618#23954618*.