PortValhalla/scripts/Windows/Software/GPU-Z/Install.ps1

33 lines
1.3 KiB
PowerShell

#!/bin/pwsh
param($context)
. "$PSScriptRoot/../../Scripts/Context.ps1";
. "$PSScriptRoot/../../Scripts/BrowserAutomation.ps1";
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
Write-Host "Installing GPU-Z";
$tempDir = $context.GetTempDirectory();
$versionSelector = ".versions .version:first-of-type .file";
$versionButtonSelector = "${versionSelector}.selected input.startbutton";
$downloadButtonSelector = 'button[type="submit"]:first-of-type';
$action = {
param([OpenQA.Selenium.Firefox.FirefoxDriver] $browser)
$versions = $browser.FindElements([OpenQA.Selenium.By]::CssSelector($versionSelector));
$version = ($versions | Where-Object { $_.Text.ToUpper().Contains("ASUS ROG"); })[0];
$version.Click();
$versionButton = $browser.FindElement([OpenQA.Selenium.By]::CssSelector($versionButtonSelector));
$versionButton.Click();
$downloadButton = $browser.FindElement([OpenQA.Selenium.By]::CssSelector($downloadButtonSelector));
$downloadButton.Click();
}
Write-Information "Downloading GPU-Z";
$file = Start-CustomDownload $context "https://www.techpowerup.com/download/techpowerup-gpu-z/" $action $tempDir;
Write-Information "Launching GPU-Z installer";
Start-Process -Wait -FilePath $file.FullName -ArgumentList "-installSilent";
Remove-Item -Recurse $tempDir;