Skip to content

Commit 73dd364

Browse files
committed
Fixes stacktrace in plugin output, when pkugin is not installed
Caused by newly introduces Get-Help check to fetch arguments
1 parent 6d127a8 commit 73dd364

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/core/tools/ConvertTo-IcingaPowerShellArguments.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ function ConvertTo-IcingaPowerShellArguments()
2525
return @{ };
2626
}
2727

28-
$CommandHelp = Get-Help -Name $Command -Full;
28+
$CommandHelp = Get-Help -Name $Command -Full -ErrorAction SilentlyContinue;
29+
30+
# Ensure we do not cause exceptions along the border in case the plugin is not installed
31+
if ($null -eq $CommandHelp) {
32+
return @{ };
33+
}
2934

3035
[hashtable]$IcingaArguments = @{ };
3136
[int]$ArgumentIndex = 0;

0 commit comments

Comments
 (0)