【发布时间】:2021-04-01 05:00:40
【问题描述】:
这是我的 PowerShell,它正在调用 API 并返回 JSON 响应。
$output = Get-SurveyParticipents `
-url "https://orxsurveys.limequery.com/admin/remotecontrol" `
-session $sessionKey `
-id "519965" `
-start "0" `
-limit "2" `
-unused $False `
-attributes ["completed", "usesleft"]
($output | Export-Csv -NoTypeInformation ./testtt.csv)
写入主机 $output 产生:
@{tid=6; token=35ddmyQTlNpzLat; participant_info=} @{tid=7; token=nQ_S838LjYT4mR6; participant_info=}
谁能指出正确的方向,将“participant_info”转换为有效的 json 以用于 CSV 导出? - 你可以告诉我,除了将它用于 SharePoint 之外,我对 PowerShell 几乎没有经验。谢谢!
【问题讨论】:
-
那不是 json。 $output 看起来像是被 write-host 转换为字符串的对象。
-
感谢您的澄清:)
标签: json powershell api csv