Commit 7dc276b7 authored by justcoding121's avatar justcoding121

install cert elevated

parent f99b9a24
...@@ -126,12 +126,11 @@ Task Package -depends Document { ...@@ -126,12 +126,11 @@ Task Package -depends Document {
#install root cetificate needed for integration tests #install root cetificate needed for integration tests
Task PrepareIntegrationTest { Task PrepareIntegrationTest {
$pfx = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
$certPath = "$Here\lib\root-certificate-for-integration-test.pfx" $startInfo = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
$pfxPass = "" $startInfo.Arguments = "$Here\install-certificate.ps1";
$pfx.import($certPath,$pfxPass,"Exportable,PersistKeySet") $startInfo.Verb = "runas";
$store = new-object System.Security.Cryptography.X509Certificates.X509Store([System.Security.Cryptography.X509Certificates.StoreName]::Root, "localmachine") $process = [System.Diagnostics.Process]::Start($startInfo);
$store.open("MaxAllowed") $process.WaitForExit()
$store.add($pfx)
$store.close()
} }
\ No newline at end of file
$Here = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$pfx = new-object System.Security.Cryptography.X509Certificates.X509Certificate2
$certPath = "$Here\lib\root-certificate-for-integration-test.pfx"
$pfxPass = ""
$pfx.import($certPath,$pfxPass,"Exportable,PersistKeySet")
$store = new-object System.Security.Cryptography.X509Certificates.X509Store([System.Security.Cryptography.X509Certificates.StoreName]::Root, "localmachine")
$store.open("MaxAllowed")
$store.add($pfx)
$store.close()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment