2023-07-27 16:06:41 -05:00
|
|
|
Function Get-WinUtilToggleStatus {
|
|
|
|
<#
|
|
|
|
|
2023-10-19 17:12:55 -05:00
|
|
|
.SYNOPSIS
|
|
|
|
Pulls the registry keys for the given toggle switch and checks whether the toggle should be checked or unchecked
|
|
|
|
|
|
|
|
.PARAMETER ToggleSwitch
|
|
|
|
The name of the toggle to check
|
|
|
|
|
|
|
|
.OUTPUTS
|
|
|
|
Boolean to set the toggle's status to
|
|
|
|
|
2023-07-27 16:06:41 -05:00
|
|
|
#>
|
|
|
|
|
|
|
|
Param($ToggleSwitch)
|
|
|
|
if($ToggleSwitch -eq "WPFToggleDarkMode"){
|
|
|
|
$app = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').AppsUseLightTheme
|
|
|
|
$system = (Get-ItemProperty -path 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize').SystemUsesLightTheme
|
|
|
|
if($app -eq 0 -and $system -eq 0){
|
|
|
|
return $true
|
2023-10-19 17:12:55 -05:00
|
|
|
}
|
2023-07-27 16:06:41 -05:00
|
|
|
else{
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($ToggleSwitch -eq "WPFToggleBingSearch"){
|
|
|
|
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
|
|
|
|
if($bingsearch -eq 0){
|
|
|
|
return $false
|
2023-10-19 17:12:55 -05:00
|
|
|
}
|
2023-07-27 16:06:41 -05:00
|
|
|
else{
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
}
|
2023-11-14 15:45:48 -06:00
|
|
|
if($ToggleSwitch -eq "WPFToggleNumLock"){
|
|
|
|
$numlockvalue = (Get-ItemProperty -path 'HKCU:\Control Panel\Keyboard').InitialKeyboardIndicators
|
|
|
|
if($numlockvalue -eq 2){
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($ToggleSwitch -eq "WPFToggleVerboseLogon"){
|
|
|
|
$VerboseStatusvalue = (Get-ItemProperty -path 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System').VerboseStatus
|
|
|
|
if($VerboseStatusvalue -eq 1){
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if($ToggleSwitch -eq "WPFToggleShowExt"){
|
|
|
|
$hideextvalue = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').HideFileExt
|
|
|
|
if($hideextvalue -eq 0){
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
}
|
2024-01-25 14:44:51 -06:00
|
|
|
if($ToggleSwitch -eq "WPFToggleSnapFlyout"){
|
|
|
|
$hidesnap = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced').EnableSnapAssistFlyout
|
|
|
|
if($hidesnap -eq 0){
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
}
|
2023-11-14 15:45:48 -06:00
|
|
|
if($ToggleSwitch -eq "WPFToggleMouseAcceleration"){
|
|
|
|
$MouseSpeed = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseSpeed
|
|
|
|
$MouseThreshold1 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold1
|
|
|
|
$MouseThreshold2 = (Get-ItemProperty -path 'HKCU:\Control Panel\Mouse').MouseThreshold2
|
|
|
|
|
|
|
|
if($MouseSpeed -eq 1 -and $MouseThreshold1 -eq 6 -and $MouseThreshold2 -eq 10){
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
}
|
2024-02-03 11:42:14 -06:00
|
|
|
if ($ToggleSwitch -eq "WPFToggleStickyKeys") {
|
|
|
|
$StickyKeys = (Get-ItemProperty -path 'HKCU:\Control Panel\Accessibility\StickyKeys').Flags
|
|
|
|
if($StickyKeys -eq 58){
|
|
|
|
return $false
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
return $true
|
|
|
|
}
|
|
|
|
}
|
2023-07-27 16:06:41 -05:00
|
|
|
}
|