winutil/functions/private/Get-WinUtilToggleStatus.ps1

32 lines
1018 B
PowerShell
Raw Normal View History

Test 2023 7 20 (#917) * Remove Edge from Start Menu and Desktop (#898) * Update edgeremoval.bat * Fix Edge not being deleted from Desktop * Compile Winutil * fix yubikey users service * Compile Winutil * AJRouter and Kiosk Disable * Compile Winutil * TermService enable This service will hang when applying tweaks. Changing to Auto from Manual * Compile Winutil * Fix bug with Telemetry Tweak services should NOT be tweaked here * dupe tweak removal * hibernate off and delete * Compile Winutil * Cleaning Windows Update Folder * Compile Winutil * GameDVR Fix * Compile Winutil * Fixed consistency in variable names and values inside edgeremoval.bat (#902) * Compile Winutil * add spdx license * Compile Winutil * Updated Dark mode check (#904) * Compile Winutil * Update Dark Mode Check updated the theme check to use the existing function * Description update Updated Description --------- Co-authored-by: DeveloperDurp <DeveloperDurp@users.noreply.github.com> * Compile Winutil * fixes #569 * Compile Winutil * Added Bing Search toggle plus some support functions (#908) * Compile Winutil * Update winget.ps1 * Compile Winutil * Fix Winget Install * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Update Install-WinUtilWinget.ps1 * Compile Winutil * Winget fixes * Compile Winutil --------- Co-authored-by: Antun Nitraj <antnitraj@gmail.com> Co-authored-by: ChrisTitusTech <ChrisTitusTech@users.noreply.github.com> Co-authored-by: DeveloperDurp <developerdurp@durp.info> Co-authored-by: DeveloperDurp <DeveloperDurp@users.noreply.github.com>
2023-07-27 16:06:41 -05:00
Function Get-WinUtilToggleStatus {
<#
.DESCRIPTION
Meant to pull the registry keys for a toggle switch and returns true or false
True should mean status is enabled
False should mean status is disabled
#>
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
}
else{
return $false
}
}
if($ToggleSwitch -eq "WPFToggleBingSearch"){
$bingsearch = (Get-ItemProperty -path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Search').BingSearchEnabled
if($bingsearch -eq 0){
return $false
}
else{
return $true
}
}
}