r/LearnPowerShell • • Nov 08 '20

How to kill a hanging script automatically

New to powershell so asking here, I have a working script running on an EC2 instance that gets called whenever x happens. However there is a scenario where the script will not complete due to Start-Process waiting on another service to finish. How would you guys make it so that after say X minutes either kill the script or kill start-process? Google is not coming up with any results

1 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/condrow Mar 04 '21

So timer will run alongside process ? This is interesting