Hi folks,
I have hit a brick wall with this problem. Hopefully I can explain it properly since I already struck out with google.
I have data that I pulled from an API. The response was JSON but it looked like Powershell automatically converted it to a PSCustomObject. Ok, so far no problem as I can access all the data from the response. The real problem is I need different parts of the object so I can export it to a CSV or possibly directly into SQL but that’s a different problem. Right now I just can’t wrap my head around getting the data the way I need it.
So I have my object stored in $stats.
$stats.start & $stats.end just contain the date/time of the metrics and apply to all samples and would therefore need to be repeated.
$stats.items actually hold the metrics I need.
i.e.
breakdown_1 metrics ----------- ----------------- @{id=61093; name=Toronto} {3859851.4375, 236.6875} @{id=80334; name=New York} {6214069.317073171, 540.80208333333337} @{id=79296; name=Boston} {1616149.763888889, 93.805555555555557}
How to I grab all of that data and output into one ‘table’?
Such as:
ID, Name, Start, End, Metric1, Metric2
Thanks,