mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-17 02:10:36 -06:00
Merge pull request #3 from Marterich/blueswill-refactor
Blueswill refactor for performance and readability
This commit is contained in:
commit
3fe482b943
@ -2,23 +2,20 @@ function Invoke-WinUtilGPU {
|
|||||||
$gpuInfo = Get-CimInstance Win32_VideoController
|
$gpuInfo = Get-CimInstance Win32_VideoController
|
||||||
|
|
||||||
# GPUs to blacklist from using Demanding Theming
|
# GPUs to blacklist from using Demanding Theming
|
||||||
|
$lowPowerGPUs = (
|
||||||
|
"*NVIDIA GeForce*M*",
|
||||||
|
"*NVIDIA GeForce*Laptop*",
|
||||||
|
"*NVIDIA GeForce*GT*",
|
||||||
|
"*AMD Radeon(TM)*",
|
||||||
|
"*UHD*"
|
||||||
|
)
|
||||||
|
|
||||||
foreach ($gpu in $gpuInfo) {
|
foreach ($gpu in $gpuInfo) {
|
||||||
$gpuName = $gpu.Name
|
foreach ($gpuPattern in $lowPowerGPUs){
|
||||||
if ($gpuName -like "*NVIDIA GeForce*M*" -OR
|
if ($gpu.Name -like $gpuPattern) {
|
||||||
$gpuName -like "*NVIDIA GeForce*Laptop*" -OR
|
|
||||||
$gpuName -like "*NVIDIA GeForce*GT*" -OR
|
|
||||||
$gpuName -like "*AMD Radeon(TM)*" -OR
|
|
||||||
$gpuName -like "*UHD*") {
|
|
||||||
return $false
|
return $false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
# 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
|
return $true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user