datum
datum copied to clipboard
Convert PSCustomObject to Hashtable
Convert the CustomObject that ConvertFrom-Json produces to a hashtable. This implementation does not use newtonsoft.json but rather haphazardly converts the PSCustomObject to a hashtable.
The alternative approach is to take on another dependency to newtonsoft.json
and then do ConvertFrom-JsonNewtonsoft -String (Get-Content -Path $Path -Encoding $Encoding -Raw) | ConvertTo-Datum -DatumHandlers $DatumHandlers
I don't really get why we need this and why we don't use ConvertFrom-Yaml for the JSON... I only had a look on my phone for a sec...
I was unaware that a YAML module would convert JSON. Sounds like a simple fix then.