Fixes stacktrace in plugin output, when pkugin is not installed

Caused by newly introduces Get-Help check to fetch arguments
This commit is contained in:
Lord Hepipud 2022-08-28 11:29:59 +02:00
parent 6d127a8082
commit 73dd3648d3

View file

@ -25,7 +25,12 @@ function ConvertTo-IcingaPowerShellArguments()
return @{ };
}
$CommandHelp = Get-Help -Name $Command -Full;
$CommandHelp = Get-Help -Name $Command -Full -ErrorAction SilentlyContinue;
# Ensure we do not cause exceptions along the border in case the plugin is not installed
if ($null -eq $CommandHelp) {
return @{ };
}
[hashtable]$IcingaArguments = @{ };
[int]$ArgumentIndex = 0;