Fixes broken switch arguments in basket configurator

Fixes #39
This commit is contained in:
Christian Stein 2020-02-03 17:28:31 +01:00
parent 61a6aaee7c
commit ac98e88626

View file

@ -148,7 +148,7 @@ function Get-IcingaCheckCommandConfig()
} }
# Add arguments to a given command # Add arguments to a given command
if ($parameter.type.name -eq 'switch') { if ($parameter.type.name -eq 'SwitchParameter') {
$Basket.Command[$Data.Name].arguments.Add( $Basket.Command[$Data.Name].arguments.Add(
[string]::Format('-{0}', $parameter.Name), @{ [string]::Format('-{0}', $parameter.Name), @{
'set_if' = $IcingaCustomVariable; 'set_if' = $IcingaCustomVariable;
@ -160,7 +160,7 @@ function Get-IcingaCheckCommandConfig()
$Basket.Command[$Data.Name].vars.Add($parameter.Name, $FALSE); $Basket.Command[$Data.Name].vars.Add($parameter.Name, $FALSE);
# Conditional whether type of parameter is array # Conditional whether type of parameter is array
} elseif ($parameter.type.name -eq 'array') { } elseif ($parameter.type.name -eq 'Array') {
$Basket.Command[$Data.Name].arguments.Add( $Basket.Command[$Data.Name].arguments.Add(
[string]::Format('-{0}', $parameter.Name), @{ [string]::Format('-{0}', $parameter.Name), @{
'value' = @{ 'value' = @{