Merge pull request #3 from Marterich/blueswill-refactor

Blueswill refactor for performance and readability
This commit is contained in:
Justawildwolf 2024-06-27 17:12:26 +00:00 committed by GitHub
commit 3fe482b943
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,23 +2,20 @@ function Invoke-WinUtilGPU {
$gpuInfo = Get-CimInstance Win32_VideoController
# GPUs to blacklist from using Demanding Theming
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*NVIDIA GeForce*M*" -OR
$gpuName -like "*NVIDIA GeForce*Laptop*" -OR
$gpuName -like "*NVIDIA GeForce*GT*" -OR
$gpuName -like "*AMD Radeon(TM)*" -OR
$gpuName -like "*UHD*") {
return $false
}
}
$lowPowerGPUs = (
"*NVIDIA GeForce*M*",
"*NVIDIA GeForce*Laptop*",
"*NVIDIA GeForce*GT*",
"*AMD Radeon(TM)*",
"*UHD*"
)
# GPUs to whitelist on using Demanding Theming
foreach ($gpu in $gpuInfo) {
$gpuName = $gpu.Name
if ($gpuName -like "*NVIDIA*" -OR
$gpuName -like "*AMD Radeon RX*") {
return $true
foreach ($gpuPattern in $lowPowerGPUs){
if ($gpu.Name -like $gpuPattern) {
return $false
}
}
}
}
return $true
}