Isn't Invoke-WebRequest the one that makes it really hard to have an exit code != 0 if your request fails?