From 2df18aadff4a6ed0e7419936be9c034403886446 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Tue, 5 Nov 2019 09:18:54 +0100 Subject: [PATCH] Fixes Agent installation prompt --- .../misc/Start-IcingaAgentInstallWizard.psm1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 index 5a19232..582e244 100644 --- a/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 +++ b/lib/core/icingaagent/misc/Start-IcingaAgentInstallWizard.psm1 @@ -189,13 +189,18 @@ function Start-IcingaAgentInstallWizard() Write-Host ([string]::Format('Using package source "{0}" for the Icinga 2 Agent package', $PackageSource)); $AllowVersionChanges = $TRUE; $InstallerArguments += '-AllowVersionChanges 1'; - } - if ([string]::IsNullOrEmpty($AgentVersion)) { - $AgentVersion = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please specify the version you wish to install ("latest", "snapshot", or a version like "2.11.0")' -Default 'v' -DefaultInput 'latest').answer; + if ([string]::IsNullOrEmpty($AgentVersion)) { + $AgentVersion = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please specify the version you wish to install ("latest", "snapshot", or a version like "2.11.0")' -Default 'v' -DefaultInput 'latest').answer; + $InstallerArguments += "-AgentVersion '$AgentVersion'"; + + Write-Host ([string]::Format('Installing Icinga Version: "{0}"', $AgentVersion)); + } + } else { + $AllowVersionChanges = $FALSE; + $InstallerArguments += '-AllowVersionChanges 0'; $InstallerArguments += "-AgentVersion '$AgentVersion'"; - - Write-Host ([string]::Format('Installing Icinga Version: "{0}"', $AgentVersion)); + $AgentVersion = ''; } } } else {