icinga-powershell-framework/lib/webserver/Get-IcingaForWindowsCertificate.psm1
2021-09-02 09:23:10 +02:00

11 lines
440 B
PowerShell

function Get-IcingaForWindowsCertificate()
{
[string]$CertificateFolder = Join-Path -Path (Get-IcingaFrameworkRootPath) -ChildPath 'certificate';
[string]$CertificateFile = Join-Path -Path $CertificateFolder -ChildPath 'icingaforwindows.pfx';
if (-Not (Test-Path $CertificateFile)) {
return $null;
}
return ([Security.Cryptography.X509Certificates.X509Certificate2]::CreateFromCertFile($CertificateFile));
}