Я использую powershell для Windows 10. Мне нужно сохранить json-файл в формате отпечатанного отпечатка. Я пробовал различные комбинации кода ниже без везения.Сохранение JSON в файл с красивой печатью с помощью Powershell
$url = example.com/api/someThingy $saveAs = people.json Invoke-RestMethod -Uri $url -Method Get -OutFile $saveAs;
JSON Sample (Существует вероятность того, что я снял то, что делает разницу.)
{"id":"123456","name":"Lorem", "content":null,"purpose":"<p>is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>\n<p>is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>","when":"<ul>\n<li>Sed ut perspiciatis unde omnis iste natus error sit voluptatem</li>\n</ul>","Purpose":"<p>is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>\n<p>is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. </p>"}
У меня были проблемы с дублирующими ключевыми именами с этим решением. Опять же, не представленный в моем примере выше. –
Ну, тогда вам нужно исправить образец. Одно дело - удалить конфиденциальную информацию, но мы должны иметь возможность воспроизвести проблему. –
Прошу прощения, я думаю, что некоторые из важных данных - моя проблема. –