PortValhalla/scripts/Windows/Scripts/AsusSoftwarePackage.ps1

16 lines
597 B
PowerShell

. "$PSScriptRoot/../../Common/ScriptsContext.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;
}