I'm working on a project where I need to track various aspects like project name, start time, end time, and current state (which could be not started, running, or complete). Each project has multiple runs, and I want to keep track of their states, including start, stop, and elapsed time. I'm considering using a JSON file for data persistence. Does anyone have suggestions on how to best approach this?
4 Answers
In one of my projects, I just saved a JSON file in the user’s home directory. Once loaded, it functions as a custom PowerShell object where each property corresponds to a value I want to keep track of.
It really comes down to what you expect for your project's future. For local scripts, I usually stick with CSV or JSON. Don't overthink it unless you know scalability will be an issue later on.
You might want to check out using export-clixml and import-clixml to save and load your state objects. It’s a straightforward approach if you’re after simplicity.
I personally write everything to an external SQL server. It's a bit overkill, but I have easy access since I'm a DBA. If you're looking for something simpler locally, CSV could also be a good option alongside JSON.

Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically