How can I optimize this Powershell script, converting JSON to CSV?
问题 I have a very large JSON Lines File with 4.000.000 Rows, and I need to convert several events from every row. The resulted CSV File contains 15.000.000 rows. How can I optimize this script? I'm using Powershell core 7 and it takes around 50 hours to complete the conversion. My Powershell script: $stopwatch = [system.diagnostics.stopwatch]::StartNew() $totalrows = 4000000 $encoding = [System.Text.Encoding]::UTF8 $i = 0 $ig = 0 $output = @() $Importfile = "C:\file.jsonl" $Exportfile = "C:\file