From 850e8b4d3f43f6f92887554c63ea56eadba69a42 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 22 Jul 2019 13:15:44 +0200 Subject: [PATCH] Added support to add additional checks to package by code --- lib/icinga/plugin/New-IcingaCheckPackage.psm1 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index 6570e89..aa857f9 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -44,6 +44,12 @@ function New-IcingaCheckPackage() } } + $Check | Add-Member -membertype ScriptMethod -name 'AddCheck' -value { + param($check); + + $this.checks += $check; + } + $Check | Add-Member -membertype ScriptMethod -name 'Compile' -value { param([bool]$Silent);