diff --git a/scripts/Windows/Scripts/Software.ps1 b/scripts/Windows/Scripts/Software.ps1 index 3cdd2776..ac2d1eae 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,