Skip to content

Instantly share code, notes, and snippets.

@marcosnils
Last active September 5, 2017 17:19
Show Gist options
  • Save marcosnils/2673c34c2fec50019502199fb7d28a61 to your computer and use it in GitHub Desktop.
Save marcosnils/2673c34c2fec50019502199fb7d28a61 to your computer and use it in GitHub Desktop.
param([string]$DTR_URL)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
invoke-webrequest -uri "https://$DTR_URL/ca" -o c:\ca.crt
$cert = new-object System.Security.Cryptography.X509Certificates.X509Certificate2 c:\ca.crt
$store = new-object System.Security.Cryptography.X509Certificates.X509Store('Root','localmachine')
$store.Open('ReadWrite')
$store.Add($cert)
$store.Close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment