mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2026-02-03 04:09:29 -05:00
Merge pull request #571 from Icinga:fix/get-help_for_plugin_not_installed_causes_stacktraces_in_icinga_output
Fix: StackTrace in plugin output, when plugin is not installed Caused by newly introduced `Get-Help` check to fetch argument types
This commit is contained in:
commit
1ef7120201
1 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue