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:
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.