Networking / RFC Checking HTTPS Certificate Expiration with PowerShell — Directly Using .NET SslStream
Use .NET TcpClient and SslStream from PowerShell to check the server certificate, expiration date, and remaining days of an HTTPS site.