diff --git a/scripts/Windows/Scripts/SoftwarePackage.ps1 b/scripts/Windows/Scripts/SoftwarePackage.ps1 index 55f08e01e..8ed5e182d 100644 --- a/scripts/Windows/Scripts/SoftwarePackage.ps1 +++ b/scripts/Windows/Scripts/SoftwarePackage.ps1 @@ -6,12 +6,13 @@ function Install-SoftwarePackage([Context] $context, [string] $location, [string if (-not ($local.IsPresent)) { $tempDir = $context.GetTempDirectory(); + $tempFile = Join-Path $tempDir "download.tmp"; - $response = Invoke-WebRequest $location; + $response = Invoke-WebRequest $location -OutFile $tempFile; $fileName = [System.IO.Path]::GetFileName($response.Headers["Location"]); $filePath = Join-Path $tempDir $fileName; - Invoke-WebRequest $location $filePath; + Move-Item $tempFile $filePath; } else { $filePath = $location; }