Pretty new to PowerShell and hoping someone can point me in the right direction.
I need to perform a POST request and have to pass it a locally stored cert (x509) during
It's pretty easy to convert C# to PowerShell. Give this a try:
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
$cert = [System.Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromCertFile("C:\Users\Andy\Desktop\Test.cer")
$web = [System.Net.WebRequest]::Create($url)
$web.ClientCertificates.Add($Cert)
I adapted this from: http://support.microsoft.com/kb/895971
Looks like the key is the ClientCertificates property.
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.clientcertificates.aspx