I have the json output in powershell as below type
IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True String System.Object
with content as below.
{
"columns": [
{
"name": "@timestamp",
"type": "datetime"
},
{
"name": "first.hostname",
"type": "text"
},
{
"name": "username",
"type": "text"
},
{
"name": "payload",
"type": "text"
},
{
"name": "domain",
"type": "text"
}
],
"rows": [
[
"2021-06-23T07:53:17.294Z",
"Name1",
"User1",
"Message",
"Domain"
],
[
"2021-06-23T07:53:17.294Z",
"Name1",
"User1",
"Message",
"Domain"
]
]
}
I need to be able to write this column and row mapping to a MSSQL DB. I am familiar with writing a datatable to DB in powershell. The part where i am struggling is to convert this content into a proper datatable.