Run a powershell script in the background once per minute

powershell, scheduling, windows

Solution

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.

Problem

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

Original source