Running PowerShell Scripts as Scheduled Task – like Cronjobs for Windows!!

If you have jobs that need to execute regularly, you can manage them with a PowerShell script and make it a scheduled task:

schtasks /CREATE /TN CheckHealthScript /TR "powershell.exe `
-noprofile -executionpolicy Unrestricted `
-file %public%\checkhealth.ps1" /IT /RL HIGHEST /SC DAILY

To remove the scheduled task, specify the name you assigned:

schtasks /DELETE /TN CheckHealthScript

Just like a Cronjob, but in Windows!! Use this to run rebuilds and updates of software to web. Automate the build numbers etc, and never worry about manually releasing interim builds again.



About Cameron
I'm a final year Computer Science/Information Systems major. Already finished my BA in Politics/Philosophy. I do web and software freelance on the side, while I finish studying. Hoping to be self-employed by the end of my degree, otherwise off into the real-world I go....

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: