33 lines
891 B
PowerShell
33 lines
891 B
PowerShell
|
function Import-Cert {
|
||
|
<#
|
||
|
.SYNOPSIS
|
||
|
Imports a Certificate into a Store.
|
||
|
#>
|
||
|
|
||
|
[CmdletBinding()]
|
||
|
Param(
|
||
|
|
||
|
[Parameter(Mandatory=$true)]
|
||
|
[string]$certFullName,
|
||
|
|
||
|
[parameter(Mandatory=$true)]
|
||
|
[System.Security.Cryptography.X509Certificates.StoreName]$storeName,
|
||
|
|
||
|
[Parameter(Mandatory=$false)]
|
||
|
[string]$importPassword
|
||
|
)
|
||
|
|
||
|
if ($importPassword)
|
||
|
{
|
||
|
return [Alkami.Ops.Common.Cryptography.CertificateHelper]::LoadCertificateToStore(
|
||
|
$certFullName,
|
||
|
$storeName,
|
||
|
[System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine,
|
||
|
$importPassword);
|
||
|
}
|
||
|
|
||
|
return [Alkami.Ops.Common.Cryptography.CertificateHelper]::LoadCertificateToStore(
|
||
|
$certFullName,
|
||
|
$storeName,
|
||
|
[System.Security.Cryptography.X509Certificates.StoreLocation]::LocalMachine);
|
||
|
}
|