Add console output

This commit is contained in:
Manuel Thalmann 2023-07-15 12:25:42 +02:00
parent de58359af4
commit 7e4b132644

View file

@ -8,15 +8,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) {