mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
Adds support to suppress messages for Disable-IcingaUntrustedCertificateValidation
This commit is contained in:
parent
c39ea59986
commit
650db57496
2 changed files with 18 additions and 6 deletions
|
|
@ -26,6 +26,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
|
|||
* [#796](https://github.com/Icinga/icinga-powershell-framework/issues/796) [#798](https://github.com/Icinga/icinga-powershell-framework/issues/798) Fixes an issue with the new check handling, which did not properly convert values from checks to the correct performance data values and base values in some cases
|
||||
* [#797](https://github.com/Icinga/icinga-powershell-framework/issues/797) Fixes plugins throwing `UNKNOWN` in case `-TresholdInterval` is used for Metrics over Time, when checks are newly registered and checked, before the first MoT is executed and collected
|
||||
|
||||
### Enhancements
|
||||
|
||||
* [#810](https://github.com/Icinga/icinga-powershell-framework/pull/810) Adds support to suppress messages for `Disable-IcingaUntrustedCertificateValidation`
|
||||
|
||||
## 1.13.3 (tbd)
|
||||
|
||||
* [#800](https://github.com/Icinga/icinga-powershell-framework/pull/800) Fixes an issue for certain plugins, like `Invoke-IcingaCheckProcess`, which reports unknown if MetricsOverTime is used for checks that do not write performance data
|
||||
|
|
|
|||
|
|
@ -1,14 +1,22 @@
|
|||
function Disable-IcingaUntrustedCertificateValidation()
|
||||
{
|
||||
param (
|
||||
[switch]$SuppressMessages = $FALSE
|
||||
);
|
||||
|
||||
try {
|
||||
[System.Net.ServicePointManager]::CertificatePolicy = $null;
|
||||
|
||||
Write-IcingaConsoleNotice 'Successfully disabled untrusted certificate validation for this shell instance';
|
||||
if ($SuppressMessages -eq $FALSE) {
|
||||
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
|
||||
)
|
||||
);
|
||||
if ($SuppressMessages -eq $FALSE) {
|
||||
Write-IcingaConsoleError (
|
||||
[string]::Format(
|
||||
'Failed to disable untrusted certificate policy: {0}', $_.Exception.Message
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue