0

I found the code snippet below in multiple places on the web. I was just curious to know if it is changing the ServicePointManager permanently or if it is only doing so in the currently running script. Thank you in advance for the assistance.

`add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy`

I have looked in multiple locations but I don't see any info on this.

TNola
  • 1

0 Answers0