From cf6b4bdf3a87ad71bd369f2afd023329bfaa67cd Mon Sep 17 00:00:00 2001 From: Justawildwolf Date: Thu, 27 Jun 2024 06:34:32 +0800 Subject: [PATCH 1/2] Update Invoke-WinUtilGPU.ps1 --- functions/private/Invoke-WinUtilGPU.ps1 | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/functions/private/Invoke-WinUtilGPU.ps1 b/functions/private/Invoke-WinUtilGPU.ps1 index e5436f82..38f5594d 100644 --- a/functions/private/Invoke-WinUtilGPU.ps1 +++ b/functions/private/Invoke-WinUtilGPU.ps1 @@ -1,13 +1,30 @@ function Invoke-WinUtilGPU { $gpuInfo = Get-CimInstance Win32_VideoController - + + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*NVIDIA GeForce*M*") { + return $false # NVIDIA M series GPU found + } + } + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*NVIDIA GeForce*Laptop*") { + return $false # NVIDIA Laptop series GPU found + } + } + foreach ($gpu in $gpuInfo) { + $gpuName = $gpu.Name + if ($gpuName -like "*NVIDIA GeForce*GT*") { + return $false # NVIDIA GT series GPU found + } + } foreach ($gpu in $gpuInfo) { $gpuName = $gpu.Name if ($gpuName -like "*NVIDIA*") { return $true # NVIDIA GPU found } } - foreach ($gpu in $gpuInfo) { $gpuName = $gpu.Name if ($gpuName -like "*AMD Radeon RX*") { From a75020f21180da97672ea388f25e67207f865b6b Mon Sep 17 00:00:00 2001 From: "Mr.k" Date: Thu, 27 Jun 2024 03:04:22 +0300 Subject: [PATCH 2/2] Re-Formate 'Invoke-WinUtilGPU.ps1' Private Function to be Shorter --- functions/private/Invoke-WinUtilGPU.ps1 | 50 +++++++------------------ 1 file changed, 14 insertions(+), 36 deletions(-) diff --git a/functions/private/Invoke-WinUtilGPU.ps1 b/functions/private/Invoke-WinUtilGPU.ps1 index 38f5594d..2ec22c01 100644 --- a/functions/private/Invoke-WinUtilGPU.ps1 +++ b/functions/private/Invoke-WinUtilGPU.ps1 @@ -1,46 +1,24 @@ 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*") { - return $false # NVIDIA M series GPU found + 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 } } + + # GPUs to whitelist on using Demanding Theming foreach ($gpu in $gpuInfo) { $gpuName = $gpu.Name - if ($gpuName -like "*NVIDIA GeForce*Laptop*") { - return $false # NVIDIA Laptop series GPU found + if ($gpuName -like "*NVIDIA*" -OR + $gpuName -like "*AMD Radeon RX*") { + return $true } } - foreach ($gpu in $gpuInfo) { - $gpuName = $gpu.Name - if ($gpuName -like "*NVIDIA GeForce*GT*") { - return $false # NVIDIA GT series GPU found - } - } - foreach ($gpu in $gpuInfo) { - $gpuName = $gpu.Name - if ($gpuName -like "*NVIDIA*") { - return $true # NVIDIA GPU found - } - } - foreach ($gpu in $gpuInfo) { - $gpuName = $gpu.Name - if ($gpuName -like "*AMD Radeon RX*") { - return $true # AMD GPU Found - } - } - foreach ($gpu in $gpuInfo) { - $gpuName = $gpu.Name - if ($gpuName -like "*UHD*") { - return $false # Intel Intergrated GPU Found - } - } - foreach ($gpu in $gpuInfo) { - $gpuName = $gpu.Name - if ($gpuName -like "*AMD Radeon(TM)*") { - return $false # AMD Intergrated GPU Found - } - } -} \ No newline at end of file +}