Running PowerShell Scripts as a Service

by Jan 26, 2010

You should call powershell.exe with the options -noprofile -command like this to run a PowerShell script externally:

Powershell.exe -noprofile -command c:\…\script.ps1

Schedule it as a task if you want to run a script as a service. You can simply add a scheduled task inside your control panel, and specify powershell.exe as the application to run. Place the rest of your line in the arguments field. With the options of your scheduled task, you can then decide whether you want to hide the PowerShell window, the account the script runs under, and the privileges it should receive.

Twitter This Tip! ReTweet this Tip!