diff --git a/functions/private/Invoke-WinUtilSnapFlyout.ps1 b/functions/private/Invoke-WinUtilSnapFlyout.ps1 index bfb83c314f..39d1335bdf 100644 --- a/functions/private/Invoke-WinUtilSnapFlyout.ps1 +++ b/functions/private/Invoke-WinUtilSnapFlyout.ps1 @@ -14,7 +14,7 @@ function Invoke-WinUtilSnapFlyout { Write-Host "Disabling Snap Assist Flyout On startup" $value = 0 } - # taskkill.exe /F /IM "explorer.exe" + $Path = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" taskkill.exe /F /IM "explorer.exe" Set-ItemProperty -Path $Path -Name EnableSnapAssistFlyout -Value $value diff --git a/functions/public/Invoke-WPFToggle.ps1 b/functions/public/Invoke-WPFToggle.ps1 index d0b79da129..c4fbd1055d 100644 --- a/functions/public/Invoke-WPFToggle.ps1 +++ b/functions/public/Invoke-WPFToggle.ps1 @@ -15,23 +15,25 @@ function Invoke-WPFToggle { # Use this to get the name of the button #[System.Windows.MessageBox]::Show("$Button","Chris Titus Tech's Windows Utility","OK","Info") + $ToggleStatus = (Get-WinUtilToggleStatus $Button) + Switch -Wildcard ($Button) { - "WPFToggleDarkMode" {Invoke-WinUtilDarkMode -DarkMoveEnabled $(Get-WinUtilToggleStatus WPFToggleDarkMode)} - "WPFToggleBingSearch" {Invoke-WinUtilBingSearch $(Get-WinUtilToggleStatus WPFToggleBingSearch)} - "WPFToggleNumLock" {Invoke-WinUtilNumLock $(Get-WinUtilToggleStatus WPFToggleNumLock)} - "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $(Get-WinUtilToggleStatus WPFToggleVerboseLogon)} - "WPFToggleShowExt" {Invoke-WinUtilShowExt $(Get-WinUtilToggleStatus WPFToggleShowExt)} - "WPFToggleSnapWindow" {Invoke-WinUtilSnapWindow $(Get-WinUtilToggleStatus WPFToggleSnapWindow)} - "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $(Get-WinUtilToggleStatus WPFToggleSnapFlyout)} - "WPFToggleSnapSuggestion" {Invoke-WinUtilSnapSuggestion $(Get-WinUtilToggleStatus WPFToggleSnapSuggestion)} - "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $(Get-WinUtilToggleStatus WPFToggleMouseAcceleration)} - "WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $(Get-WinUtilToggleStatus WPFToggleStickyKeys)} - "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $(Get-WinUtilToggleStatus WPFToggleTaskbarWidgets)} - "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $(Get-WinUtilToggleStatus WPFToggleTaskbarSearch)} - "WPFToggleTaskView" {Invoke-WinUtilTaskView $(Get-WinUtilToggleStatus WPFToggleTaskView)} - "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $(Get-WinUtilToggleStatus WPFToggleHiddenFiles)} - "WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $(Get-WinUtilToggleStatus WPFToggleTaskbarAlignment)} - "WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $(Get-WinUtilToggleStatus WPFToggleDetailedBSoD)} + "WPFToggleDarkMode" {Invoke-WinUtilDarkMode $ToggleStatus} + "WPFToggleBingSearch" {Invoke-WinUtilBingSearch $ToggleStatus} + "WPFToggleNumLock" {Invoke-WinUtilNumLock $ToggleStatus} + "WPFToggleVerboseLogon" {Invoke-WinUtilVerboseLogon $ToggleStatus} + "WPFToggleShowExt" {Invoke-WinUtilShowExt $ToggleStatus} + "WPFToggleSnapWindow" {Invoke-WinUtilSnapWindow $ToggleStatus} + "WPFToggleSnapFlyout" {Invoke-WinUtilSnapFlyout $ToggleStatus} + "WPFToggleSnapSuggestion" {Invoke-WinUtilSnapSuggestion $ToggleStatus} + "WPFToggleMouseAcceleration" {Invoke-WinUtilMouseAcceleration $ToggleStatus} + "WPFToggleStickyKeys" {Invoke-WinUtilStickyKeys $ToggleStatus} + "WPFToggleTaskbarWidgets" {Invoke-WinUtilTaskbarWidgets $ToggleStatus} + "WPFToggleTaskbarSearch" {Invoke-WinUtilTaskbarSearch $ToggleStatus} + "WPFToggleTaskView" {Invoke-WinUtilTaskView $ToggleStatus} + "WPFToggleHiddenFiles" {Invoke-WinUtilHiddenFiles $ToggleStatus} + "WPFToggleTaskbarAlignment" {Invoke-WinUtilTaskbarAlignment $ToggleStatus} + "WPFToggleDetailedBSoD" {Invoke-WinUtilDetailedBSoD $ToggleStatus} } }