mirror of
https://github.com/ChrisTitusTech/winutil
synced 2026-06-04 14:17:27 +00:00
459d0fd1b2
* Fixed Get-WinUtilToggleStatus.ps1 displaying incorrect infromation of tweaks * Update Get-WinUtilToggleStatus.ps1 * Update Get-WinUtilToggleStatus.ps1 * Update Get-WinUtilToggleStatus.ps1 * Update Get-WinUtilToggleStatus.ps1
31 lines
853 B
PowerShell
31 lines
853 B
PowerShell
Function Get-WinUtilToggleStatus ($ToggleSwitch) {
|
|
|
|
$ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry
|
|
|
|
if (-not (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) {
|
|
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS | Out-Null
|
|
}
|
|
|
|
foreach ($regentry in $ToggleSwitchReg) {
|
|
|
|
if (-not (Test-Path $regentry.Path)) {
|
|
New-Item -Path $regentry.Path -Force | Out-Null
|
|
}
|
|
|
|
$regstate = (Get-ItemProperty -Path $regentry.Path).$($regentry.Name)
|
|
|
|
if ($null -eq $regstate) {
|
|
switch ($regentry.DefaultState) {
|
|
"true" { $regstate = $regentry.Value }
|
|
"false" { $regstate = $regentry.OriginalValue }
|
|
}
|
|
}
|
|
|
|
if ($regstate -ne $regentry.Value) {
|
|
return $false
|
|
}
|
|
}
|
|
|
|
return $true
|
|
}
|