diff --git a/functions/private/Get-WinUtilToggleStatus.ps1 b/functions/private/Get-WinUtilToggleStatus.ps1 index b30aea94..0ac3f208 100644 --- a/functions/private/Get-WinUtilToggleStatus.ps1 +++ b/functions/private/Get-WinUtilToggleStatus.ps1 @@ -19,25 +19,32 @@ Function Get-WinUtilToggleStatus { if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) { New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS write-host "Created HKU drive" + if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) { + Write-Host "HKU drive created successfully" -ForegroundColor Green + } else { + Write-Host "Failed to create HKU drive" + } } if ($ToggleSwitchReg) { $count = 0 foreach ($regentry in $ToggleSwitchReg) { - $regstate = (Get-ItemProperty -path $($regentry.Path)).$($regentry.Name) + write-host "Checking $($regentry.path)" + $regstate = (Get-ItemProperty -path $regentry.Path).$($regentry.Name) if ($regstate -eq $regentry.Value) { $count += 1 + write-host "$($regentry.Name) is true (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))" -ForegroundColor Green } else { - write-debug "$($regentry.Name) is false (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))" + write-host "$($regentry.Name) is false (state: $regstate, value: $($regentry.Value), original: $($regentry.OriginalValue))" } } if ($count -eq $ToggleSwitchReg.Count) { - write-debug "$($ToggleSwitchReg.Name) is true (count: $count)" + write-host "$($ToggleSwitchReg.Name) is true (count: $count)" -ForegroundColor Green return $true } else { - write-debug "$($ToggleSwitchReg.Name) is false (count: $count)" + write-host "$($ToggleSwitchReg.Name) is false (count: $count)" return $false } } else { diff --git a/functions/private/Invoke-WinUtilTweaks.ps1 b/functions/private/Invoke-WinUtilTweaks.ps1 index f5bedfcf..d64f4cd9 100644 --- a/functions/private/Invoke-WinUtilTweaks.ps1 +++ b/functions/private/Invoke-WinUtilTweaks.ps1 @@ -77,9 +77,14 @@ function Invoke-WinUtilTweaks { if($sync.configs.tweaks.$CheckBox.registry) { $sync.configs.tweaks.$CheckBox.registry | ForEach-Object { Write-Debug "$($psitem.Name) and state is $($psitem.$($values.registry))" - if (($psitem.Path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) { + if (($ToggleSwitchReg.path -imatch "hku") -and !(Get-PSDrive -Name HKU -ErrorAction SilentlyContinue)) { New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS write-host "Created HKU drive" + if (Get-PSDrive -Name HKU -ErrorAction SilentlyContinue) { + Write-Host "HKU drive created successfully" + } else { + Write-Host "Failed to create HKU drive" + } } Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry) } diff --git a/functions/public/Invoke-WPFUIElements.ps1 b/functions/public/Invoke-WPFUIElements.ps1 index 8ce21f88..90fb8760 100644 --- a/functions/public/Invoke-WPFUIElements.ps1 +++ b/functions/public/Invoke-WPFUIElements.ps1 @@ -192,7 +192,13 @@ function Invoke-WPFUIElements { $sync[$entryInfo.Name] = $checkBox - $sync[$entryInfo.Name].IsChecked = Get-WinUtilToggleStatus $entryInfo.Name + $sync[$entryInfo.Name].IsChecked = (Get-WinUtilToggleStatus $entryInfo.Name) + + if ($sync[$entryInfo.Name].IsChecked) { + write-host "$($entryInfo.Name) is checked" -ForegroundColor Blue + } else { + write-host "$($entryInfo.Name) is not checked" -ForegroundColor Red + } $sync[$entryInfo.Name].Add_Checked({ [System.Object]$Sender = $args[0]