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

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

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

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


        
6条回答
  •  旧巷少年郎
    2021-02-01 15:25

    Just pipe it to Set-Content, or Out-File:

    Get-Process powershell |
     ConvertTo-Json | 
     Set-Content json.txt
    

提交回复
热议问题