I have a bunch of servers and I want to check if the URL https://servername:portnumber is opening or cannot load anything.
I tried using Invoke-WebRequest -URI https://servername:portnumber, however it says:
The underlying connection was closed. An unexpected error occurred on a send.
When I try to access this URL in the browser it works. However I want to find if the url can load or could not load using powershell. Any suggestions on how to achieve this?