Skip to content

Commit

Permalink
Changes in Common
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivangi authored and Shivangi committed Nov 15, 2019
1 parent ae1d4b3 commit 09d811b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Tasks/Common/VstsAzureHelpers_/Utility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
[Switch] $ServicePrincipal
)

# Add the certificate to the cert store.
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2
$certificate = ""

if ($ServicePrincipal) {
$pemFileContent = $Endpoint.Auth.Parameters.ServicePrincipalCertificate
$pfxFilePath, $pfxFilePassword = ConvertTo-Pfx -pemFileContent $pemFileContent

$certificate.Import($pfxFilePath, $pfxFilePassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::PersistKeySet)
# Add the certificate to the cert store.
$certificate = New-Object System.Security.Cryptography.X509Certificates.X509Certificate2($pfxFilePath, $pfxFilePassword, [System.Security.Cryptography.X509Certificates.X509KeyStorageFlags]::PersistKeySet)
}
else {
$bytes = [System.Convert]::FromBase64String($Endpoint.Auth.Parameters.Certificate)
Expand Down

0 comments on commit 09d811b

Please sign in to comment.