icinga-powershell-framework/lib/webserver/Get-IcingaForWindowsCertificate.psm1

12 lines
440 B
PowerShell
Raw Normal View History

2021-08-06 12:12:27 -04:00
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));
}