Created
October 12, 2017 17:08
-
-
Save snobu/a20b9b955078e2ffd5d0c6f77f6ce135 to your computer and use it in GitHub Desktop.
PowerShell call service without cert validation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $True } | |
| $url = 'https://self-signed.badssl.com/' | |
| $apiReq = [System.Net.HttpWebRequest]::CreateHttp($url) | |
| $apiRes = $apiReq.GetResponse() | |
| Out-File -Encoding Ascii -FilePath $res -InputObject $(ConvertTo-Json $apiRes) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment