Set Powershell to skip SSL certificate checks
NOTE: This is NOT a recommended practice! You should have valid certificates and CA Servers!
If you are trying to query a web site and you have invalid SSL certificates, Powershell is by default very strict on what it accepts. You will often end up with errors like:
or
When you try to use Invoke-WebRequest
or Invoke-RestMethod
on a web URL with old or insecure certificates or CAs. Example:
To get around this, try running the script fragment below before you make your remote calls.
This performs bypasses for the certificate issues.
Last updated