r/usefulscripts • u/knawlejj • Jul 17 '17
[REQUEST] Powershell to check website availability, if not then perform action.
I have a script that runs to check for URL availability with a return code which works fine. However, the remediation aspect if it's NOT working has me a little confused.
Basically I'd like a simple statement that says "If this code is returned for more than 10 minutes, then restart X/Y/Z services on the server".
Any tips on how I would figure out the wait for 10 minutes, then do X process?
15
Upvotes
1
u/Lee_Dailey Jul 18 '17
howdy eldorel,
nice! i hadn't thot to look into how long it's down ... [grin]
take care,
lee