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