mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-02-04 06:50:09 +00:00
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:
committed by
GitHub
parent
8eaf6ddd9c
commit
eeb410e985
@@ -21,7 +21,7 @@ function Invoke-WinUtilTweaks {
|
|||||||
$KeepServiceStartup = $true
|
$KeepServiceStartup = $true
|
||||||
)
|
)
|
||||||
|
|
||||||
if ($Checkbox -contains "Toggle") {
|
if ($Checkbox -like "*Toggle*") {
|
||||||
$CheckBox = $sync.configs.tweaks.$CheckBox
|
$CheckBox = $sync.configs.tweaks.$CheckBox
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user