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.
This commit is contained in:
Akhil Kumar Achanta
2025-11-17 12:29:56 -05:00
committed by GitHub
parent 8eaf6ddd9c
commit eeb410e985

View File

@@ -21,7 +21,7 @@ function Invoke-WinUtilTweaks {
$KeepServiceStartup = $true
)
if ($Checkbox -contains "Toggle") {
if ($Checkbox -like "*Toggle*") {
$CheckBox = $sync.configs.tweaks.$CheckBox
}