Add script for installing GPU-Z

This commit is contained in:
Manuel Thalmann 2023-07-16 23:07:49 +02:00
parent 35a69fb2fc
commit 91087b7c76
2 changed files with 36 additions and 0 deletions

View file

@ -27,6 +27,8 @@ function Backup-PersonalApps([Context] $context) {
}
function Restore-PersonalApps([Context] $context) {
$softwareDir = "$PSScriptRoot/../Software";
# Backed up applications
Restore-Git $context;
Restore-LogitechGHUB $context;
@ -52,6 +54,8 @@ function Restore-PersonalApps([Context] $context) {
keepass `
gimp;
. "$softwareDir/GPU-Z/Install.ps1";
# Media
choco install -y k-litecodecpackmega;

View file

@ -0,0 +1,32 @@
#!/bin/pwsh
param($context)
. "$PSScriptRoot/../../Scripts/Context.ps1";
. "$PSScriptRoot/../../Scripts/BrowserAutomation.ps1";
. "$PSScriptRoot/../../Scripts/SoftwarePackage.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;