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)) {
|
if (-not ($local.IsPresent)) {
|
||||||
$tempDir = $context.GetTempDirectory();
|
$tempDir = $context.GetTempDirectory();
|
||||||
|
|
||||||
$request = [System.Net.WebRequest]::Create($location);
|
$response = Invoke-WebRequest $location;
|
||||||
$request.AllowAutoRedirect = $false;
|
$fileName = [System.IO.Path]::GetFileName($response.Headers["Location"]);
|
||||||
$response = $request.GetResponse();
|
|
||||||
$fileName = [System.IO.Path]::GetFileName($response.GetResponseHeader("Location"));
|
|
||||||
|
|
||||||
$filePath = Join-Path $tempDir $fileName;
|
$filePath = Join-Path $tempDir $fileName;
|
||||||
|
Invoke-WebRequest $location $filePath;
|
||||||
} else {
|
} else {
|
||||||
$filePath = $location;
|
$filePath = $location;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue