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

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

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

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


        
6条回答
  •  Happy的楠姐
    2021-02-01 15:20

    If you want to both view the output and save it to file, you can pipe the tee command.

    Get-Process powershell | ConvertTo-Json |  Tee-Object json.txt
    

提交回复
热议问题