I have a small script that retrieves a website's SSL's expiring date.
here's the code:
[Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}$timeoutMilliseconds = 10000$req = $null$req = [Net.HttpWebRequest]::Create("https://google.com")$req.Timeout = $timeoutMilliseconds$req.GetResponse();$expiration = $req.ServicePoint.Certificate.GetExpirationDateString()$expiration
This works exactly twice(!) before throwing a "Getresponse with 0 arguments".If I re-open powershell it'll work again exactly 2 times.I'm unsure what's going on here...