Pull the certificate the server actually sends
The browser hides the chain behind a warning. A direct TLS handshake in PowerShell prints the subject, the issuer and the validity dates without a security prompt.
$h = 'example.com'
$req = [Net.HttpWebRequest]::Create("https://$h")
$req.Timeout = 10000
try { $req.GetResponse() | Out-Null } catch { $_.Exception.Message }
$req.ServicePoint.Certificate | Select-Object Subject,Issuer,GetEffectiveDateString,GetExpirationDateString