User
I am trying to exporting pfx certificate from a website that includes all the certificates in the certification path if possible through powershell. The code that i tried for achieving it works but it does not includes all the certificates in the certification path. My code is :
$webRequest = [Net.WebRequest]::Create("url")
$cert = $webRequest.ServicePoint.Certificate
try {
$webRequest.GetResponse()
}
catch {}
$bytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pfx)
set-content -value $bytes -encoding byte -path "C:\cer.pfx"
Please suggest how can i achieve it? Thanks
General Tech Technology & Software
1 Replies