fix cs cert import

This commit is contained in:
OCram85 2019-04-04 15:51:08 +02:00
parent ec004c4f03
commit b787342b69

View File

@ -159,6 +159,7 @@ function New-CredentialStore {
Confirm = $false Confirm = $false
} }
# test if there is already a cert
if ((Test-Path $PfxParams.CertName) -and (! $Force.IsPresent)) { if ((Test-Path $PfxParams.CertName) -and (! $Force.IsPresent)) {
$ErrorParams = @{ $ErrorParams = @{
Exception = [System.IO.InvalidDataException]::new( Exception = [System.IO.InvalidDataException]::new(
@ -208,8 +209,8 @@ function New-CredentialStore {
$ObjProperties.PfxCertificate = $PfxParams.CertName $ObjProperties.PfxCertificate = $PfxParams.CertName
} }
else { else {
Write-Verbose 'Importing new PFX certifiate file' Write-Verbose 'Importing new PFX certificate file...'
Import-CSCertificate -Path $PfxParams.CertName Import-CSCertificate -Path $PfxParams.CertName -StoreName My -StoreLocation CurrentUser
} }
} }