Scheduling PowerShell Scripts

Just a quick Post…

Yesterday I had to schedule PowerShell scripts on a Windows 2003 Server, this following technique worked for me but I have not tested it on other OS platform.
Similar to a VBScript in the AT scheduled job you point to a .bat or .cmd file for the Program to run. In this file you have the below code to initialize the script in its shell.

In the .bat or .cmd file you will need the following code.

Powershell -NoLogo -Command "&{C:\Scripts\Posh\Script1.ps1}"

Hope this helps.

All information is provided on an AS-IS basis, with no warranties and confers no rights.

Tags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">