小编And*_*und的帖子

使用PowerShell将JSON转换为CSV

在这里有一个JSON格式的示例,如果我使用类似的东西,它会很好地转换:https://konklone.io/json/

我在PowerShell中尝试了以下代码:

(Get-Content -Path $pathToJsonFile | ConvertFrom-Json) 
| ConvertTo-Csv -NoTypeInformation 
| Set-Content $pathToOutputFile
Run Code Online (Sandbox Code Playgroud)

但我得到的唯一结果是:

{"totalCount":19,"resultCount":19,"hasMore":false,"results":
Run Code Online (Sandbox Code Playgroud)

如何在PowerShell中正确转换?

csv powershell json

6
推荐指数
3
解决办法
2万
查看次数

标签 统计

csv ×1

json ×1

powershell ×1