Add script for installing amd chipset driver

This commit is contained in:
Manuel Thalmann 2023-07-15 12:18:13 +02:00
parent f6bc1a624b
commit cfd7c17fc7
3 changed files with 31 additions and 0 deletions
scripts/Windows/Scripts

View file

@ -0,0 +1,25 @@
. "$PSScriptRoot/Context.ps1";
function Install-SoftwarePackage([Context] $context, [string] $location, [string[]] $argumentList = @("/S"), [switch]$local) {
[string]$filePath = "";
[string]$tempDir = $null;
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"));
$filePath = Join-Path $tempDir $fileName;
} else {
$filePath = $location;
}
Start-Process -Wait -FilePath $filePath -ArgumentList $argumentList;
if ($tempDir) {
Remove-Item -Recurse $tempDir;
}
}