Fixes Agent installation processing if no version is specified

This commit is contained in:
Lord Hepipud 2019-11-05 09:21:49 +01:00
parent 2df18aadff
commit 47f721e62c

View file

@ -12,6 +12,11 @@ function Install-IcingaAgent()
$IcingaInstaller = Get-IcingaAgentMSIPackage -Source $Source -Version $Version -SkipDownload;
$InstallTarget = $IcingaData.RootDir;
if ([string]::IsNullOrEmpty($Version)) {
Write-Host 'No Icinga Agent version specified. Skipping installation.';
return $FALSE;
}
if ($IcingaData.Installed -eq $TRUE -and $AllowUpdates -eq $FALSE) {
Write-Host 'The Icinga Agent is already installed on this system. To perform updates or downgrades, please add the "-AllowUpdates" argument';
return $FALSE;