Is there an easy way to expand one JSON file to another and save the output to another file using PowerShell? I'm currently trying to write a repeating function that will allow me to do this *, but maybe there is a simpler solution?
* PSCustomObject over JSON properties converted to PSCustomObject and replace them if necessary (actually check my answer below )
Edit: I need to do something similar to what jquery.extend does, my input:
{ "name": "Some name", "value": 1, "config": { "debug": false, "output": "c:\\" } }
and
{ "value": 2, "config": { "debug": true }, "debug": { "log": true } }
And my conclusion should be:
{ "name": "Some name", "value": 2, "config": { "debug": true, "output": "c:\\" }, "debug": { "log": true } }
PS As a rule, I need to write a script that can be run from a batch file and does not require third-party libraries (limited by Windows resources). I tried my luck with JavaScript Cscript, but I decided not to use it when I found out that the only built-in method for parsing JSON is to evaluate it.
json powershell
jahu
source share