From 60d9691f454bf216a1b3c9927485d9faec745dff Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 15 Jul 2023 12:21:38 +0200 Subject: [PATCH] Try fixing non-functioning scripts --- scripts/Windows/Scripts/SoftwarePackage.ps1 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/scripts/Windows/Scripts/SoftwarePackage.ps1 b/scripts/Windows/Scripts/SoftwarePackage.ps1 index 3dac0bcf..55f08e01 100644 --- a/scripts/Windows/Scripts/SoftwarePackage.ps1 +++ b/scripts/Windows/Scripts/SoftwarePackage.ps1 @@ -7,12 +7,11 @@ function Install-SoftwarePackage([Context] $context, [string] $location, [string if (-not ($local.IsPresent)) { $tempDir = $context.GetTempDirectory(); - $request = [System.Net.WebRequest]::Create($location); - $request.AllowAutoRedirect = $false; - $response = $request.GetResponse(); - $fileName = [System.IO.Path]::GetFileName($response.GetResponseHeader("Location")); + $response = Invoke-WebRequest $location; + $fileName = [System.IO.Path]::GetFileName($response.Headers["Location"]); $filePath = Join-Path $tempDir $fileName; + Invoke-WebRequest $location $filePath; } else { $filePath = $location; }