mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2025-01-15 09:20:36 -06:00
Persist Choco Preference across program restarts
This commit is contained in:
parent
a3ab1409e5
commit
44c6ecc334
@ -87,6 +87,14 @@ try {
|
||||
|
||||
$xaml.SelectNodes("//*[@Name]") | ForEach-Object {$sync["$("$($psitem.Name)")"] = $sync["Form"].FindName($psitem.Name)}
|
||||
|
||||
#Persist the Chocolatey preference across winutil restarts
|
||||
$ChocoPreferencePath = "$env:LOCALAPPDATA\winutil\preferChocolatey.ini"
|
||||
$sync.WPFpreferChocolatey.Add_Checked({New-Item -Path $ChocoPreferencePath -Force })
|
||||
$sync.WPFpreferChocolatey.Add_Unchecked({Remove-Item $ChocoPreferencePath -Force})
|
||||
if (Test-Path $ChocoPreferencePath){
|
||||
$sync.WPFpreferChocolatey.IsChecked = $true
|
||||
}
|
||||
|
||||
$sync.keys | ForEach-Object {
|
||||
if($sync.$psitem) {
|
||||
if($($sync["$psitem"].GetType() | Select-Object -ExpandProperty Name) -eq "CheckBox" `
|
||||
|
Loading…
Reference in New Issue
Block a user