From e06b22622e0c497c1d5d9251ba6fc8e70acd2f19 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Fri, 6 Sep 2024 12:41:37 +0200 Subject: [PATCH] specifying download path directly on Invoke-RestMethod --- install.ps1 | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install.ps1 b/install.ps1 index 18f90da..22baa64 100644 --- a/install.ps1 +++ b/install.ps1 @@ -40,12 +40,15 @@ if ($isRelease) Copy-Item -Path "$releaseDir\*" -Destination $programPath -Recurse -Force } else { + # Specify temporary output Path + $tmpPRSWzip = "$env:TMP\ProxySwitcher.zip" + # Download release files from github as-is Write-Host "Downloading program into local directory..." -ForegroundColor Cyan - Invoke-RestMethod "https://github.com/Baipyrus/ProxySwitcher/releases/latest/download/ProxySwitcher.zip" -OutFile $env:TMP + Invoke-RestMethod "https://github.com/Baipyrus/ProxySwitcher/releases/latest/download/ProxySwitcher.zip" -OutFile $tmpPRSWzip # Expand Archive to program directory - Expand-Archive "$env:TMP\ProxySwitcher.zip" -DestinationPath $programPath + Expand-Archive $tmpPRSWzip -DestinationPath $programPath } # Add program to PATH for cli application