Skip to content

Commit

Permalink
fix HKU
Browse files Browse the repository at this point in the history
- load HKU if needed (for tweaks & GetToggleStatus)
- remove unneeded Invoke-WinUtilNumLock
- has loaded HKU does not load/not stay loaded
  • Loading branch information
MyDrift-user committed Nov 6, 2024
1 parent a93d44a commit 5c2d5fa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 33 deletions.
8 changes: 6 additions & 2 deletions config/tweaks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3310,10 +3310,14 @@
}
],
"InvokeScript": [
"Invoke-WinUtilExplorerRefresh"
"
Invoke-WinUtilExplorerRefresh
"
],
"UndoScript": [
"Invoke-WinUtilExplorerRefresh"
"
Invoke-WinUtilExplorerRefresh
"
],
"link": "https://christitustech.github.io/winutil/dev/tweaks/Customize-Preferences/DarkMode"
},
Expand Down
5 changes: 5 additions & 0 deletions functions/private/Get-WinUtilToggleStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ Function Get-WinUtilToggleStatus {

$ToggleSwitchReg = $sync.configs.tweaks.$ToggleSwitch.registry

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 ($ToggleSwitchReg) {
$count = 0

Expand Down
31 changes: 0 additions & 31 deletions functions/private/Invoke-WinUtilNumLock.ps1

This file was deleted.

4 changes: 4 additions & 0 deletions functions/private/Invoke-WinUtilTweaks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ 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)) {
New-PSDrive -PSProvider Registry -Name HKU -Root HKEY_USERS
write-host "Created HKU drive"
}
Set-WinUtilRegistry -Name $psitem.Name -Path $psitem.Path -Type $psitem.Type -Value $psitem.$($values.registry)
}
}
Expand Down

0 comments on commit 5c2d5fa

Please sign in to comment.