Skip to content

Commit 4c62866

Browse files
committed
Adds support to suppress messages for Disable-IcingaUntrustedCertificateValidation
1 parent f328837 commit 4c62866

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

doc/100-General/10-Changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
2424
* [#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
2525
* [#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
2626

27+
### Enhancements
28+
29+
* [#810](https://github.com/Icinga/icinga-powershell-framework/pull/810) Adds support to suppress messages for `Disable-IcingaUntrustedCertificateValidation`
30+
2731
## 1.13.3 (tbd)
2832

2933
* [#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
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
function Disable-IcingaUntrustedCertificateValidation()
22
{
3+
param (
4+
[switch]$SuppressMessages = $FALSE
5+
);
6+
37
try {
48
[System.Net.ServicePointManager]::CertificatePolicy = $null;
59

6-
Write-IcingaConsoleNotice 'Successfully disabled untrusted certificate validation for this shell instance';
10+
if ($SuppressMessages -eq $FALSE) {
11+
Write-IcingaConsoleNotice 'Successfully disabled untrusted certificate validation for this shell instance';
12+
}
713
} catch {
8-
Write-IcingaConsoleError (
9-
[string]::Format(
10-
'Failed to disable untrusted certificate policy: {0}', $_.Exception.Message
11-
)
12-
);
14+
if ($SuppressMessages -eq $FALSE) {
15+
Write-IcingaConsoleError (
16+
[string]::Format(
17+
'Failed to disable untrusted certificate policy: {0}', $_.Exception.Message
18+
)
19+
);
20+
}
1321
}
1422
}

0 commit comments

Comments
 (0)