r/PowerShell • u/rogueit • May 16 '26
Question Watching for a script to stall
I have a powershell job that kicks off via task schedular at 9:30 AM, and depending on the jobs it monitors determines when later that evening it should stop. However, somedays, it chokes and stalls.
How would I watch for this stall to occur, and restart the task schedular job. My initial thought would be to use a 2nd task job that fires every 15 mins and watches for the last write time on the transcript.
If you all have a better idea, I would love to know it.
thanks, RogueIT
2
Upvotes
View all comments
Show parent comment
2
u/rogueit May 16 '26
It’s a webscrape job that sometimes gets into a tar pit situation, I wonder if iwr has a timeout switch. Good call