-1

So I have a bunch of powershell scripts that I run through Task Scheduler. Depending on their tasks and the time it takes for them to run, some run every minute, others every hour and others every day and others weekly.

I run all of these scripts through Task Scheduler using the following configurations: General: ✔ Run wether user is logged on or not ✔ Run with the highest privileges ✔ Hidden

Actions: "C:\Program Files\PowerShell\7\pwsh.exe" -nologo -windowstyle Hidden -file "path to script"

Now because some of these tasks run for about 1 hour to several hours I like to have them hidden, but sometimes I'd like to be able to check how the process is doing. Is there any way to make the pwsh.exe visible? or read the output of the script?

  • 1
    I'd consider logging the output in the PowerShell scripts into files, then you could check those files as and when needed. – madoxdev Jun 16 '20 at 05:11

1 Answers1

0

Store output to some file is the easiest way.

Script ... | Out-File C:\filename.txt
rAJ
  • 1,295
  • 5
  • 31
  • 66