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

View file

@ -13,4 +13,5 @@ function Install-PortValhallaDrivers {
. "$mbDriverPath/IntelWiFi/Install.ps1" $context;
. "$mbDriverPath/AMDChipsetX399/Install.ps1" $context;
. "$mbDriverPath/IntelBluetooth/Install.ps1" $context;
. "$driverPath/AMDChipsetX399/Install.ps1" $context;
}

View file

@ -0,0 +1,5 @@
#!/bin/pwsh
param([Context] $context)
. "$PSScriptRoot/../../Scripts/SoftwarePackage.ps1";
Install-SoftwarePackage $context "https://drivers.amd.com/drivers/amd_chipset_software_5.05.16.529.exe";

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;
}
}