icinga-powershell-framework/lib/web/Disable-IcingaUntrustedCertificateValidation.psm1
2020-05-29 14:49:34 +02:00

14 lines
458 B
PowerShell

function Disable-IcingaUntrustedCertificateValidation()
{
try {
[System.Net.ServicePointManager]::CertificatePolicy = $null;
Write-IcingaConsoleNotice 'Successfully disabled untrusted certificate validation for this shell instance';
} catch {
Write-IcingaConsoleError (
[string]::Format(
'Failed to disable untrusted certificate policy: {0}', $_.Exception.Message
)
);
}
}