From 164a3b60ef0cb6fac1c7ab451c1a72913e263b34 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 7 Aug 2024 14:40:24 +0200 Subject: [PATCH] Add a script for installing ASUS packages --- scripts/Windows/Scripts/Software.ps1 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index f270c70d..67ce76be 100644 --- a/scripts/Windows/Scripts/Software.ps1 +++ b/scripts/Windows/Scripts/Software.ps1 @@ -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,