Run a powershell script in the background once per minute

magol picture magol · Jan 15, 2010 · Viewed 82.2k times · Source

I want a powershell script to be run once per minute in the background. No window may appear. How do I do it?

Answer

Joey picture Joey · Jan 15, 2010

Use the Windows Task Scheduler and run your script like this:

powershell -File myScript.ps1 -WindowStyle Hidden

Furthermore create the script that it runs under a specific user account and not only when that user is logged on. Otherwise you'll see a console window.