24 Mar 2015

Scheduling PowerShell Scripts

I have a requirement to run a PowerShell .ps1 file each evening to perform a backup in an AWS environment. Having written the .ps1 script and placed it on the server. I've now created the Task with the following parameters using the Task Scheduler GUI.

Program/script C:\Windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe

Add arguments -File ".\EC2_Backup.ps1"

Start in D:\Scripts

To invoke the AWS connection details for the region and access keys, I also added the following to the top of the script

Initialize-AWSDefaults

No comments: