79125815

Date: 2024-10-25 13:07:19
Score: 1.5
Natty:
Report link

I found a really nice PS module that helps way better than convertto-json and convertfrom-json. Install Convertto-AdvancedJSON which also has ConvertFrom-AdvancedJSON. I use the -Depth 20 operator, the integer being how far the nesting layers go down into the json data. The beauty with this module is I can manipulate the data as a I loop thru it and I can POST against the API by using the $var | Convertto-AdvancedJSON | out-file -filepath ".\Body.JSON" and it converts it back to the correct JSON syntax, where the convertto-JSON leaves nested properties with a leading @ symbol which doesn't meet the syntax.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Single line (0.5):
  • Low reputation (1):
Posted by: Carlos Albor