Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2314

Json to csv

$
0
0

Moin zusammen,

Ich bin relativ neu in Powershell und versuche mich gerade darin mittels Powershell aus einer JSON Datei eine CSV Datei zu machen. Folgenden Befehl nehme ich dazu:

(Get-Content -Path C:\Powershell\test.json | ConvertFrom-Json) `
| ConvertTo-Csv -NoTypeInformation `
| Set-Content C:\powershell\test.csv

Leider ist der Output nicht ganz so wie erwartet. Die JSON Datei ist knapp 5 MB Gross. Die CSV knapp 1 KB ;) In der CSV steht:

"cruises","numResults"
"System.Object[]","8083"

Cruises ist der oberste Knoten in JSON und 8083 ist die Zahl der Objekte in der JSON. Ich konnte bisher Powershell aber nicht davon überzeugen das die gesamte Datei ausgibt.

Jemand eine Idee?

Gruss

Timo


Viewing all articles
Browse latest Browse all 2314


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>