From eeb410e985fe47f26b432dc6e4b117ccb14a7c91 Mon Sep 17 00:00:00 2001 From: Akhil Kumar Achanta <71771166+ZeusCraft10@users.noreply.github.com> Date: Mon, 17 Nov 2025 12:29:56 -0500 Subject: [PATCH] fix(tweaks): Correct operator for checking tweak type in Invoke-WinUtilTweaks (#3625) The Invoke-WinUtilTweaks function was using the '-contains' operator on a string variable to check for toggle-type tweaks. This operator is intended for collections (arrays), not for substring matching within a string, leading to incorrect logic flow. This caused an issue where selecting one tweak (e.g., WPFTweaksRightClickMenu) could erroneously trigger the action of another (e.g., WPFTweaksDisableCrossDeviceResume). This commit replaces the incorrect '-contains' operator with the '-like' operator and appropriate wildcards ('*Toggle*'). This ensures that tweak types are identified correctly, resolving the bug and preventing unintended system modifications. --- functions/private/Invoke-WinUtilTweaks.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/private/Invoke-WinUtilTweaks.ps1 b/functions/private/Invoke-WinUtilTweaks.ps1 index ad79c55e..dc65952b 100644 --- a/functions/private/Invoke-WinUtilTweaks.ps1 +++ b/functions/private/Invoke-WinUtilTweaks.ps1 @@ -21,7 +21,7 @@ function Invoke-WinUtilTweaks { $KeepServiceStartup = $true ) - if ($Checkbox -contains "Toggle") { + if ($Checkbox -like "*Toggle*") { $CheckBox = $sync.configs.tweaks.$CheckBox }