2

I am using windows "scheduled tasks" to run a powershell script with parameters.

For some reason it is executing in the background rather than the foreground. I want to be able to see it executing... it takes over 1 hour to finish and I want to watch its progress.

Thanks

2 Answers 2

4

Two possible reasons that I can think of:

  • "Run whether user is logged on or not" option selected
  • paramete -WindowStyle Hidden on powershell.exe specified.

If neither is the case, than I don't know what may be the reason. Maybe some other script element that hides PowerShell window?

Sign up to request clarification or add additional context in comments.

1 Comment

Ahh... yes, it was the "Run whether user is logged on or not" flag. As soon as I turned that off and re-run the task I saw the Powershell window pop open and run in the foreground! Thanks so much!
4

Is it Windows Server or Windows 7 machine?

In Windows Sever task scheduler launches application in no user mode (unless specified in policy) versus, Windows 7 the scheduler launching application in system account. This could be reason for Windows is hidden.

Also if you script take an hour to run showing PS window is not a great idea, instead you can route your PS output to a text file and check the file details to monitor the progress when needed.

1 Comment

Thanks. That's a good suggestion. I think I will output to a file and monitor that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.