Add console output

This commit is contained in:
Manuel Thalmann 2023-07-15 12:25:42 +02:00
parent 57e12ad510
commit ecec8243b5

View file

@ -9,15 +9,19 @@ function Install-SoftwarePackage([Context] $context, [string] $location, [string
$tempDir = $context.GetTempDirectory();
$tempFile = Join-Path $tempDir "download.tmp";
Write-Information "Downloading setup file from $location";
$response = Invoke-WebRequest $location -OutFile $tempFile;
$fileName = [System.IO.Path]::GetFileName($response.Headers["Location"]);
Write-Information "Renaming setup file to $fileName";
$filePath = Join-Path $tempDir $fileName;
Move-Item $tempFile $filePath;
} else {
$filePath = $location;
}
$fileName = [System.IO.Path]::GetFileName($filePath);
Write-Information "Starting installation of $fileName";
Start-Process -Wait -FilePath $filePath -ArgumentList $argumentList;
if ($tempDir) {