Powershell script as a scheduled task

I have a powershell script that I'd like to run every 30 minutes in the background. To do this I've created a scheduled task that executes the script. However, when it runs it quickly flashes the powershell window.

The command I use in the scheduled task is :

powershell.exe -NoLogo Noprofile -WindowStyle Hidden -ExecutionPolicy Bypass -Command "& {D:\script.ps1}"

Is there a way to schedule this script in a way that it doesn't flash the powershell window?

September 5th, 2015 7:05am

A scheduled task take a program name and a set of arguments.

Program: powershell.exe
Add-Arguments:
Noprofile -WindowStyle Hidden -ExecutionPolicy Bypass -File D:\script.ps1
Start In: d:\

Be sure script has no output bits that require a Window.

Note that this is not a scripting issue but an issue of how to use the Task Scheduler.

Free Windows Admin Tool Kit Click here and download it now
September 5th, 2015 7:27am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics