Fixes Icinga Agent MSI package fetching by ignoring RC packages

Fixes #58
This commit is contained in:
Lord Hepipud 2020-04-13 16:31:55 +02:00
parent a4dfee6f8b
commit bde0005203

View file

@ -25,7 +25,6 @@ function Get-IcingaAgentMSIPackage()
foreach ($line in $Content) {
if ($line -like '*.msi*' -And $line -like "*$Architecture*") {
#Write-Host '#####' $line
$MSIPackage = $line.SubString(
$line.IndexOf('Icinga2-'),
$line.IndexOf('.msi') - $line.IndexOf('Icinga2-')
@ -43,7 +42,7 @@ function Get-IcingaAgentMSIPackage()
break;
}
} elseif ($Version -eq 'latest') {
if ($line -like '*snapshot*') {
if ($line -like '*snapshot*' -Or $line -like '*-rc*') {
continue;
}
$UsePackage = $MSIPackage;