mirror of
https://github.com/Icinga/icinga-powershell-framework.git
synced 2025-12-21 07:10:15 -05:00
Fixes missing AllowVersionChanges argument
This commit is contained in:
parent
cc519c5d4e
commit
cc7f8dfe2c
1 changed files with 6 additions and 2 deletions
|
|
@ -178,6 +178,8 @@ function Start-IcingaAgentInstallWizard()
|
||||||
}
|
}
|
||||||
|
|
||||||
Write-Host ([string]::Format('Using package source "{0}" for the Icinga 2 Agent package', $PackageSource));
|
Write-Host ([string]::Format('Using package source "{0}" for the Icinga 2 Agent package', $PackageSource));
|
||||||
|
$AllowVersionChanges = $TRUE;
|
||||||
|
$InstallerArguments += '-AllowVersionChanges 1';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ([string]::IsNullOrEmpty($AgentVersion)) {
|
if ([string]::IsNullOrEmpty($AgentVersion)) {
|
||||||
|
|
@ -191,8 +193,12 @@ function Start-IcingaAgentInstallWizard()
|
||||||
if ($null -eq $UpdateAgent) {
|
if ($null -eq $UpdateAgent) {
|
||||||
if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'The Icinga 2 Agent is already installed. Would you like to update it?' -Default 'y').result -eq 1) {
|
if ((Get-IcingaAgentInstallerAnswerInput -Prompt 'The Icinga 2 Agent is already installed. Would you like to update it?' -Default 'y').result -eq 1) {
|
||||||
$UpdateAgent = 1;
|
$UpdateAgent = 1;
|
||||||
|
$AllowVersionChanges = $TRUE;
|
||||||
|
$InstallerArguments += '-AllowVersionChanges 1';
|
||||||
} else {
|
} else {
|
||||||
$UpdateAgent = 0;
|
$UpdateAgent = 0;
|
||||||
|
$AllowVersionChanges = $FALSE;
|
||||||
|
$InstallerArguments += '-AllowVersionChanges 0';
|
||||||
}
|
}
|
||||||
$InstallerArguments += "-UpdateAgent $UpdateAgent";
|
$InstallerArguments += "-UpdateAgent $UpdateAgent";
|
||||||
}
|
}
|
||||||
|
|
@ -200,9 +206,7 @@ function Start-IcingaAgentInstallWizard()
|
||||||
if ($UpdateAgent -eq 1) {
|
if ($UpdateAgent -eq 1) {
|
||||||
if ([string]::IsNullOrEmpty($AgentVersion)) {
|
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').answer;
|
$AgentVersion = (Get-IcingaAgentInstallerAnswerInput -Prompt 'Please specify the version you wish to install ("latest", "snapshot", or a version like "2.11.0")' -Default 'v').answer;
|
||||||
$AllowVersionChanges = $TRUE;
|
|
||||||
$InstallerArguments += "-AgentVersion '$AgentVersion'";
|
$InstallerArguments += "-AgentVersion '$AgentVersion'";
|
||||||
$InstallerArguments += '-AllowVersionChanges 1';
|
|
||||||
|
|
||||||
Write-Host ([string]::Format('Updating/Downgrading Icinga 2 Agent to version: "{0}"', $AgentVersion));
|
Write-Host ([string]::Format('Updating/Downgrading Icinga 2 Agent to version: "{0}"', $AgentVersion));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue