Created
June 6, 2017 01:48
-
-
Save petarvucetin/c185eeb20ee98e16debeb0d6821caddf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Downloads latest paket.bootstrapper.exe from github | |
$urlbase = "https://github.com" | |
$latestPage="$urlbase/fsprojects/Paket/releases/latest" | |
$exe = "paket.bootstrapper.exe" | |
Write-Host "Parsing latest release page: $latestPage" | |
$urlRegex = '<a\s+(?:[^>]*?\s+)?href=(["''])(.*?)paket.bootstrapper.exe\1' | |
$wc=new-object net.webclient | |
$wc.UseDefaultCredentials=$true | |
$wc.Proxy.Credentials=$wc.Credentials | |
$content=$wc.DownloadString($latestPage) | |
$latestBootStrapper = $content | Select-String -Pattern $urlRegex -AllMatches | % { $_.Matches | % { $_.Groups[2].Value } } | |
$dlurl="$urlbase$latestBootStrapper$exe" | |
Write-Host "Downloading paket.bootstrapper.exe from $dlurl" | |
$wc.DownloadFile($dlurl, (join-path (resolve-path ".\.paket") "paket.bootstrapper.exe")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment