Add a script for installing ASUS packages

This commit is contained in:
Manuel Thalmann 2024-08-07 14:40:24 +02:00
parent 81db7a4bca
commit 979e77a95d

View file

@ -58,6 +58,32 @@ $null = New-Module {
}
}
<#
.SYNOPSIS
Installs a package downloaded from ASUS.
.PARAMETER URL
The URL to download the package from.
#>
function Install-AsusPackage {
param(
[string] $URL
)
$file = "AsusPackage.zip";
$dir = New-TemporaryDirectory;
$unpackDir = New-TemporaryDirectory;
$null = Push-Location $dir;
Invoke-WebRequest $URL -OutFile $file;
Expand-Archive $file $unpackDir;
$null = Pop-Location;
Remove-Item -Recurse $dir;
$null = Start-Process -Wait -WorkingDirectory $unpackDir -FilePath (Join-Path $unpackDir "AsusSetup.exe") -ArgumentList "/S";
Remove-Item -Recurse $unpackDir;
}
function Start-SoftwareInstaller {
param(
[string] $Name,