Thursday, 3 January 2008

Scheduling Powershell Scripts

In order to allow Powershell scripts to run as Scheduled Tasks, you first need to allow third party scripts to run as by default, Powershell will only accept typed commands.
  • set-executionpolicy RemoteSigned
Then use the following command in a .bat file to run the powershell script itself.
  • powershell -command "& 'MyScript.ps1' "

No comments: