- Write your PowerShell Script (Myscript.ps1)
- Save it to a location
- Go into Windows Sheduler and shedule your script
In Task Scheduler put in program/script: powershell (C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe)
And in arguments -Command "<path to .ps1 script>"
(-Command "C:\Powershell\Testing.ps1")
If you don't want change current execution policy permanently then use -ExecutionPolicy Bypass
All will look like this: powershell -Command "<path to .ps1 script>" -ExecutionPolicy Bypass