Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blueswill refactor for performance and readability #3

Merged
merged 4 commits into from
Jun 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions functions/private/Invoke-WinUtilGPU.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
}