mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-20 23:00:35 -05:00
Fixed check initialising for AddCheck() on Check Packages
This commit is contained in:
parent
ecef0920b4
commit
63d9445d16
1 changed files with 16 additions and 3 deletions
|
|
@ -30,12 +30,20 @@ function New-IcingaCheckPackage()
|
|||
|
||||
$Check | Add-Member -membertype ScriptMethod -name 'Initialise' -value {
|
||||
foreach ($check in $this.checks) {
|
||||
$check.verbose = $this.verbose;
|
||||
$check.AddSpacing();
|
||||
$check.SilentCompile();
|
||||
$this.InitCheck($check);
|
||||
}
|
||||
}
|
||||
|
||||
$Check | Add-Member -membertype ScriptMethod -name 'InitCheck' -value {
|
||||
if ($null -eq $check) {
|
||||
return;
|
||||
}
|
||||
|
||||
$check.verbose = $this.verbose;
|
||||
$check.AddSpacing();
|
||||
$check.SilentCompile();
|
||||
}
|
||||
|
||||
$Check | Add-Member -membertype ScriptMethod -name 'AddSpacing' -value {
|
||||
$this.spacing += 1;
|
||||
foreach ($check in $this.checks) {
|
||||
|
|
@ -47,6 +55,11 @@ function New-IcingaCheckPackage()
|
|||
$Check | Add-Member -membertype ScriptMethod -name 'AddCheck' -value {
|
||||
param($check);
|
||||
|
||||
if ($null -eq $check) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this.InitCheck($check);
|
||||
$this.checks += $check;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue