Currently i'm attempting to create a script to convert my json files to csv files. At the moment I'm receiving most of the data, but the issue i'm having is expanding out the "glyphs" field to add that data into the csv as well. Below is an example of the json currently. This is similar to what's already out there, but my problem is with the -depth that the convertfrom-json pulls. It's only going to two levels and I need it to go to four.
{
"nodes": [
{
"id": 23,
"type": "Group",
"label": "DOMAIN ADMINS@.COM",
"glyphs": {
"0": {
"position": "top-right",
"font": "\"Font Awesome 5 Free\"",
"content": "",
"fillColor": "black",
"fontScale": 1.5,
"fontStyle": "900"
}
},
"folded": {
"nodes": {},
"edges": {}
},
$user1 = $env:USERNAME
Get-Content C:\Users\$user1\Documents\json_to_convert.json |
convertfrom-json | select -ExpandProperty nodes |
Export-CSV C:\Users\$user1\Documents\jsonTest_$((Get-Date).ToString('MM-dd-yy')).csv -NoTypeInformation
So i'm just hoping to also input the "position", "font", "content", "fillColor", "fontScale", and "fontstyle" from "glyphs into my CSV file as well. Thos are the only fields i'm having trouble with.