Use Latest instead of detecting latest

We now use symlinks that always point to latest
This commit is contained in:
twangboy 2019-11-25 13:00:06 -07:00
parent f6d5027ea7
commit 15968cbdf6
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -211,27 +211,10 @@ Else {
}
#===============================================================================
# Figure out the latest version if no version is passed
# Use version "Latest" if no version is passed
#===============================================================================
# If version isn't supplied, use latest.
If (!$version) {
# Find latest version of Salt Minion
$repo = Invoke-Restmethod "$repourl"
$regex = "<\s*a\s*[^>]*?href\s*=\s*[`"']*([^`"'>]+)[^>]*?>"
$returnMatches = New-Object System.Collections.ArrayList
$resultingMatches = [Regex]::Matches($repo, $regex, "IgnoreCase")
foreach($match in $resultingMatches) {
$cleanedMatch = $match.Groups[1].Value.Trim()
[void] $returnMatches.Add($cleanedMatch)
}
If ($arch -eq 'x86') {
$returnMatches = $returnMatches | Where {$_ -like "Salt-Minion*x86-Setup.exe"}
}
Else {
$returnMatches = $returnMatches | Where {$_ -like "Salt-Minion*AMD64-Setup.exe"}
}
$version = $($returnMatches[$returnMatches.Count -1]).Split(("n-","-A","-x","-P"),([System.StringSplitOptions]::RemoveEmptyEntries))[1]
$version = "Latest"
}
$versionSection = $version