Fixes accidental conversion of array to string while they should be arrays

This commit is contained in:
Lord Hepipud 2019-11-03 20:08:43 +01:00
parent ed733881f0
commit 05f67d6a1a

View file

@ -474,7 +474,7 @@ function Set-IcingaWizardArgument()
} }
$InstallerArguments += "-$WizardArg $Override"; $InstallerArguments += "-$WizardArg $Override";
return @{ return @{
'Value' = $Override; 'Value' = $DirectorArgs.Overrides[$WizardArg];
'Args' = $InstallerArguments; 'Args' = $InstallerArguments;
}; };
} }
@ -483,15 +483,13 @@ function Set-IcingaWizardArgument()
if ($DirectorArgs.Arguments.ContainsKey($WizardArg)) { if ($DirectorArgs.Arguments.ContainsKey($WizardArg)) {
$RetValue = $DirectorArgs.Arguments[$WizardArg]; $RetValue = $DirectorArgs.Arguments[$WizardArg];
if ($Value -is [array]) {
$RetValue = [string]::Join(',', $RetValue);
}
} else { } else {
if ($null -ne $Value -Or [string]::IsNullOrEmpty($Value) -eq $FALSE) { if ($null -ne $Value -Or [string]::IsNullOrEmpty($Value) -eq $FALSE) {
$TmpValue = $Value;
if ($Value -is [array]) { if ($Value -is [array]) {
$Value = [string]::Join(',', $Value); $TmpValue = [string]::Join(',', $TmpValue);
} }
$InstallerArguments += "-$WizardArg $Value"; $InstallerArguments += "-$WizardArg $TmpValue";
return @{ return @{
'Value' = $Value; 'Value' = $Value;
'Args' = $InstallerArguments; 'Args' = $InstallerArguments;
@ -505,10 +503,11 @@ function Set-IcingaWizardArgument()
} }
if ([string]::IsNullOrEmpty($Value) -eq $FALSE) { if ([string]::IsNullOrEmpty($Value) -eq $FALSE) {
$TmpValue = $Value;
if ($Value -is [array]) { if ($Value -is [array]) {
$Value = [string]::Join(',', $Value); $TmpValue = [string]::Join(',', $Value);
} }
$InstallerArguments += "-$WizardArg $Value"; $InstallerArguments += "-$WizardArg $TmpValue";
return @{ return @{
'Value' = $Value; 'Value' = $Value;
'Args' = $InstallerArguments; 'Args' = $InstallerArguments;