2

I have a powershell script similar to below:

$Logfile = "..\Logs\DailyAutomationLogs.txt"
Start-Transcript -path $LogFile -append

$flags = 0

#Retrieve data 
powershell.exe -File .\Download1.ps1
if(-Not $?){
    $flags += 1
}

powershell.exe -File .\Download2.ps1
if(-Not $?){
    $flags += 2
}


#Upload successful documents
if(($flags -band 1) -eq 0){
    --Upload1
}
if(($flags -band 2) -eq 0){
    --Upload2
}

if($flags -eq 0){
    --Do other stuff
}

python .\DailyEmail.py $flags

Stop-Transcript

Each of the downloads takes a long time and the scripts give a lot of output I would like to be able to watch. I have a task created in task scheduler that has the actions: enter image description here

Which used to open up a powershell window while it was running, now it is hidden after a recent update. Does anyone know how to force task manager to show the window?

I have tried -WindowStyle with Normal, Minimized, Maximized and none of them worked.

I have tried pointing to a separate powershell file which calls the intended one with Start-Process, but this did not work either.

Any help would be great.

Stefan Orr
  • 191
  • 1
  • 11
  • Which update? To my knowledge, scheduled tasks haven't been capable of showing anything on an interactive desktop in a long time (possibly pre-XP) so I'm not sure how it was ever working. – briantist May 02 '16 at 13:02
  • It wasn't an update, wrong word I suppose. The IT team at my work did some Domain Controller changes and since then this behaviour has changed. I really want my old functionality back though haha. Also I'm on windows 10 – Stefan Orr May 03 '16 at 02:34

0 Answers0