I am setting up a custom script to do a remote web call (HTTP post) using Invoke-Webrequest.
I have it working, but how can I have Adaxes send an email or retry if the remote HTTP server is down or unreachable during the attempted call?
This is the error that would be output from a failed attempt in this case.
Unable to connect to the remote server. For example:
Invoke-WebRequest -URI someunreachable.com
The site has to have a valid DNS name obviously, but let's assume the site does but it is just unreachable for some reason (network, web services down, etc)