From 6304e0b1b7c11f862bd88d827f4fce51e61ca3c2 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Fri, 29 May 2020 18:35:41 +0200 Subject: [PATCH] Adds return of own object for setter functions for checks --- lib/icinga/plugin/New-IcingaCheck.psm1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/icinga/plugin/New-IcingaCheck.psm1 b/lib/icinga/plugin/New-IcingaCheck.psm1 index 78f071b..45d3173 100644 --- a/lib/icinga/plugin/New-IcingaCheck.psm1 +++ b/lib/icinga/plugin/New-IcingaCheck.psm1 @@ -100,6 +100,8 @@ function New-IcingaCheck() $null, $null ); + + return $this; } $Check | Add-Member -membertype ScriptMethod -name 'SetWarning' -value { @@ -108,6 +110,8 @@ function New-IcingaCheck() $null, $null ); + + return $this; } $Check | Add-Member -membertype ScriptMethod -name 'WarnOutOfRange' -value { @@ -318,6 +322,8 @@ function New-IcingaCheck() $null, $null ); + + return $this; } $Check | Add-Member -membertype ScriptMethod -name 'CritOutOfRange' -value {