You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am debating ways to store user preferences, like the path, additional categories, and category color schemes. This could be part of the database. But in a shared database situation, some users may have different color preferences. Thinking about storing a JSON file in $HOME that would be used on module import, if found. Would need to add commands to create or update the file. Open to other suggestions that will work cross-platform.
The text was updated successfully, but these errors were encountered:
One potential drawback to storing preferences in the database is the need to update the database table. On the other hand, separating data from formatting seems like a standard practice.
Leaning towards code like this to keep preferences separate from data.
#create a command called Update-PSWorkItemPreferences$pref= [PSCustomObject]@{
Path=$PSWorkItemPathCategories=$PSWorkItemCategory.GetEnumerator() |ForEach-Object { @{Category=$_.Key;ANSI=$_.value}}
}
$pref|ConvertTo-Json|Out-File C:\temp\pref.json
#on module import, test for preference file and import it if found$importPref=Get-Content c:\temp\pref.json |ConvertFrom-Json$PSWorkItemPath=$importPref.Path$importPref.categories.foreach({$PSWorkItemCategory[$_.category]=$_.ansi})
#otherwise, use defaults or profile-driven settings
I am debating ways to store user preferences, like the path, additional categories, and category color schemes. This could be part of the database. But in a shared database situation, some users may have different color preferences. Thinking about storing a JSON file in $HOME that would be used on module import, if found. Would need to add commands to create or update the file. Open to other suggestions that will work cross-platform.
The text was updated successfully, but these errors were encountered: