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);