diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index f941c05..d8e6a3c 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -36,6 +36,14 @@ function New-IcingaCheckPackage() $Check | Add-Member -membertype NoteProperty -name 'criticalchecks' -value @(); $Check | Add-Member -membertype NoteProperty -name 'unknownchecks' -value @(); + $Check | Add-Member -membertype ScriptMethod -name 'HasChecks' -value { + if ($this.checks -ne 0) { + return $TRUE + } + + return $FALSE; + } + $Check | Add-Member -membertype ScriptMethod -name 'Initialise' -value { foreach ($check in $this.checks) { $this.InitCheck($check);