Skip to content

Instantly share code, notes, and snippets.

@snobu
Created October 12, 2017 17:08
Show Gist options
  • Select an option

  • Save snobu/a20b9b955078e2ffd5d0c6f77f6ce135 to your computer and use it in GitHub Desktop.

Select an option

Save snobu/a20b9b955078e2ffd5d0c6f77f6ce135 to your computer and use it in GitHub Desktop.
PowerShell call service without cert validation
[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