Try fixing non-functioning scripts
This commit is contained in:
parent
cfd7c17fc7
commit
60d9691f45
1 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue