From 16d2677c4fc98eb9c869f2472140d57ff3b1ed60 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 31 May 2021 17:51:13 +0200 Subject: [PATCH] Fixes array handling for checks --- lib/icinga/plugin/New-IcingaCheckPackage.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 index 8b35d35..c63b6dc 100644 --- a/lib/icinga/plugin/New-IcingaCheckPackage.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckPackage.psm1 @@ -67,7 +67,7 @@ function New-IcingaCheckPackage() $check.__SetCheckOutput(); $check.__SetVerbosity($this.__GetVerbosity()); $check.__SetParent($this); - $this.__Checks += $check; + [array]$this.__Checks += $check; } } @@ -172,7 +172,7 @@ function New-IcingaCheckPackage() return; } - $this.__Checks = $this.__Checks | Sort-Object -Property Name; + [array]$this.__Checks = ($this.__Checks | Sort-Object -Property Name); # Loop all checks to understand the content of result foreach ($check in $this.__Checks) {