From a2afbbe5fcbd47bf0c4347073ee7ed6efdcacd60 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sat, 5 Oct 2019 21:59:37 +0200 Subject: [PATCH] Fixed CheckCommand callback to fetch executed command --- lib/icinga/plugin/New-IcingaCheckResult.psm1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/icinga/plugin/New-IcingaCheckResult.psm1 b/lib/icinga/plugin/New-IcingaCheckResult.psm1 index 9db2518..5e2a9f6 100644 --- a/lib/icinga/plugin/New-IcingaCheckResult.psm1 +++ b/lib/icinga/plugin/New-IcingaCheckResult.psm1 @@ -17,7 +17,7 @@ function New-IcingaCheckresult() return $IcingaEnums.IcingaExitCode.Unknown; } - $CheckCommand = (Get-PSCallStack)[1].Command; + $CheckCommand = (Get-PSCallStack)[2].Command; # Compile the check / package if not already done $this.check.AssignCheckCommand($CheckCommand);