From 15968cbdf6d6d29c6c9125886dbd43e3499cfed3 Mon Sep 17 00:00:00 2001 From: twangboy Date: Mon, 25 Nov 2019 13:00:06 -0700 Subject: [PATCH] Use Latest instead of detecting latest We now use symlinks that always point to latest --- bootstrap-salt.ps1 | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/bootstrap-salt.ps1 b/bootstrap-salt.ps1 index 34c8984..7957631 100644 --- a/bootstrap-salt.ps1 +++ b/bootstrap-salt.ps1 @@ -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