Last week a friend asked: Is there an easy way to covert YAML to JSON and JSON to YAML without any online-services?
As expected, my answer was: Yes, with PowerShell!
JSON is supported out of the box and there are a few PowerShell Modules that support YAML. My favorite Module is powershell-yaml, a wrapper on top of YamlDotNet.
You can install the powershell-yaml directly from the PowerShell Gallery:
Here are some examples to convert back and forth between JSON and YAML:
There is also a GIST for it.
JSON is well known as a serialization format. It is more explicit and more suitable for data interchange between your apis.
I use JSON a lot to store data, where a database is oversized. I also use JSON a lot for configuration files.
YAML (YAML Ain’t Markup Language) is in my opinion best suited for complex configuration files. And it is much better human-readable for most.