Merge pull request #621 from Icinga:fix/threshold_interval_key_detection

Fix: ThresholdInterval key detection on newer systems

On the latest Windows versions, the behavior for the dynamic detection of the argument `-ThresholdInterval` changed, as the name has been updated from `-ThresholdInterval` to `-ThresholdInterval:`.

This fix will now allow both versions of the naming, to support old and new environments.
This commit is contained in:
Lord Hepipud 2023-05-12 11:14:01 +02:00 committed by GitHub
commit 3d4a74e29d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -16,6 +16,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic
* [#603](https://github.com/Icinga/icinga-powershell-framework/issues/603) Fixes service filter to handle exclude with wildcards instead of requiring the full service name (*not* applying to the display name)
* [#609](https://github.com/Icinga/icinga-powershell-framework/issues/609) Fixes config generator to never use `set_if = true` on Icinga 2/Icinga Director configuration
* [#617](https://github.com/Icinga/icinga-powershell-framework/issues/617) Fixes failing calls for plugins which use a switch argument like `-NoPerfData`, which is followed directly by the `-ThresholdInterval` argument
* [#621](https://github.com/Icinga/icinga-powershell-framework/pull/621) Fixes `-ThresholdInterval` key detection on newer systems
### Enhancements

View file

@ -66,7 +66,7 @@ function New-IcingaCheck()
$this.__TimeInterval = $SetArg;
break;
}
if ($SetArg -eq '-ThresholdInterval') {
if ($SetArg -eq '-ThresholdInterval' -Or $SetArg -eq '-ThresholdInterval:') {
$FoundInterval = $TRUE;
continue;
}