How to schedule a Powershell script using Scheduled tasks in Windows Server 2008 R2
Powershell is a really powerfull tool but then you have to know how to schedule your scripts using the task scheduler if you would like to run script on a daily base for example.
Open the task scheduler (Start -> All Programs -> Accessories -> System Tools -> Task Scheduler
The program to start is Powershell
with the arguments:
-command “& ‘D:\yourfilewithcommands.ps1’ “
If you don’t like to change the execution policy for the computer you can use:
-ExecutionPolicy Bypass -file “D:\yourfilewithcommands.ps1”
Save the Scheduled task and now you can run it manually (or wait for it to run automatically if you like) to test it.
Now you have a scheduled powershell script