mirror of
https://github.com/Baipyrus/ProxySwitcher.git
synced 2024-12-26 12:41:45 +00:00
download most recent release instead of latest
This commit is contained in:
parent
78cd3f1734
commit
9fd7fb2c37
@ -45,7 +45,10 @@ if ($isRelease)
|
|||||||
|
|
||||||
# Download release files from github as-is
|
# Download release files from github as-is
|
||||||
Write-Host "Downloading program into local directory..." -ForegroundColor Cyan
|
Write-Host "Downloading program into local directory..." -ForegroundColor Cyan
|
||||||
Invoke-RestMethod "https://github.com/Baipyrus/ProxySwitcher/releases/latest/download/ProxySwitcher.zip" -OutFile $tmpPRSWzip
|
$releases = Invoke-RestMethod "https://api.github.com/repos/Baipyrus/ProxySwitcher/releases"
|
||||||
|
$assets = $releases[0].assets
|
||||||
|
$archive = $assets | Where-Object name -match "zip"
|
||||||
|
Invoke-RestMethod $archive.browser_download_url -OutFile $tmpPRSWzip
|
||||||
|
|
||||||
# Expand Archive to program directory
|
# Expand Archive to program directory
|
||||||
Expand-Archive $tmpPRSWzip -DestinationPath $programPath -Force
|
Expand-Archive $tmpPRSWzip -DestinationPath $programPath -Force
|
||||||
|
Loading…
Reference in New Issue
Block a user