From 05f67d6a1a095e33b6425e0b01d0c27979678ea6 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Sun, 3 Nov 2019 20:08:43 +0100 Subject: [PATCH] Fixes accidental conversion of array to string while they should be arrays --- .../misc/Start-IcingaAgentInstallWizard.psm1 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 index 9272fda..e5c25f0 100644 --- a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 +++ b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 @@ -474,7 +474,7 @@ function Set-IcingaWizardArgument() } $InstallerArguments += "-$WizardArg $Override"; return @{ - 'Value' = $Override; + 'Value' = $DirectorArgs.Overrides[$WizardArg]; 'Args' = $InstallerArguments; }; } @@ -483,15 +483,13 @@ function Set-IcingaWizardArgument() if ($DirectorArgs.Arguments.ContainsKey($WizardArg)) { $RetValue = $DirectorArgs.Arguments[$WizardArg]; - if ($Value -is [array]) { - $RetValue = [string]::Join(',', $RetValue); - } } else { if ($null -ne $Value -Or [string]::IsNullOrEmpty($Value) -eq $FALSE) { + $TmpValue = $Value; if ($Value -is [array]) { - $Value = [string]::Join(',', $Value); + $TmpValue = [string]::Join(',', $TmpValue); } - $InstallerArguments += "-$WizardArg $Value"; + $InstallerArguments += "-$WizardArg $TmpValue"; return @{ 'Value' = $Value; 'Args' = $InstallerArguments; @@ -505,10 +503,11 @@ function Set-IcingaWizardArgument() } if ([string]::IsNullOrEmpty($Value) -eq $FALSE) { + $TmpValue = $Value; if ($Value -is [array]) { - $Value = [string]::Join(',', $Value); + $TmpValue = [string]::Join(',', $Value); } - $InstallerArguments += "-$WizardArg $Value"; + $InstallerArguments += "-$WizardArg $TmpValue"; return @{ 'Value' = $Value; 'Args' = $InstallerArguments;