title: Replacing boolean values in JSON using powershell
body: <p>I'm trying to update a boolean value inside a JSON formated file using powershell but I'm not getting the required output.</p>
  
  <p>From the below,</p>
  
  <pre><code>{
  "setComputerName":  false,
  "setWallpaper":  true
  }
  </code></pre>
  
  <p>I would like to get the output as,</p>
  
  <pre><code>{
  "setComputerName":  true,
  "setWallpaper":  true
  }
  </code></pre>
  
  <p>Below is my script,</p>
  
  <pre><code>$file = Get-Content 'C:\temp\Config.json' -raw | ConvertFrom-Json
  $file = $file.setComputerName = 'true'
  $file | ConvertTo-Json  | set-content 'C:\temp\Config1.json'
  </code></pre>