How to save a JSON object to a file using Powershell?

后端 未结 6 662
情话喂你
情话喂你 2021-02-01 15:10

I have converted the following JSON file to powershell representation object.

{
\"computer\": [
    {
        \"children\": [   
            {   
                        


        
6条回答
  •  不知归路
    2021-02-01 15:24

    -depth argument for ConvertTo-Json solves the issue.

    $jsonRepresentation | ConvertTo-Json -depth 100 | Out-File "D:\dummy_path\file.json"
    

提交回复
热议问题