Add a script for installing asus packages

This commit is contained in:
Manuel Thalmann 2023-07-15 11:33:05 +02:00
parent 629978a897
commit 7f3144e482

View file

@ -0,0 +1,15 @@
. "$PSScriptRoot/Context.ps1";
function Install-AsusSoftwarePackage([Context] $context, [string] $url) {
$packageFile = "AsusPackage.zip";
$tempDir = $context.GetTempDirectory();
$null = Push-Location $tempDir;
$unpackedDir = $context.GetTempDirectory();
Invoke-WebRequest $url -OutFile $packageFile;
Expand-Archive $packageFile $unpackedDir;
$null = Pop-Location;
Remove-Item -Recurse $tempDir;
$null = Start-Process -Wait -FilePath "$(Join-Path $unpackedDir "AsusSetup.exe")" -ArgumentList "/S";
Remove-Item -Recurse $unpackedDir;
}