Just had a quick play around with a sample JSON file, as I didn’t have one to hand, and changing the attributes is trivial.
get-content .\sample2.json | ConvertFrom-Json
firstName : Joe
lastName : Jackson
gender : male
age : 28
address : @{streetAddress=101; city=San Diego; state=CA}
phoneNumbers : {@{type=home; number=7349282382}}
To alter the firstname, lastname, and age of this person we do this:
$json.firstName = "Keith"
$json.lastName = "Richards"
$json.age = "78"
$json
firstName : Keith
lastName : Richards
gender : male
age : 78
address : @{streetAddress=101; city=San Diego; state=CA}
phoneNumbers : {@{type=home; number=7349282382}}
We now save this file out, into either a new file, or in this case we would overwrite the original to change the default.
$json | ConvertTo-Json | Out-File altered_sample2.json
The layout of the file is slightly different in the case of the attributes with multiple values, like address, and phone numbers, but its valid JSON as far as I can see, so this should be easy.
Without having the actual JSON files in front of my I don’t know what their layout would be, but I would imagine there would be a block for each effect, and an “Enabled/Disabled” nested within it. Identify the correct effect, turn it off, save it out.
I downloaded the addon, and have a play around with the “def_piston.json”.
Let’s say I wanted to turn off the sneezing. Ingest the file:
$json = Get-Content -Path .\def_piston.json | ConvertFrom-Json
Disabled sneezing:
$json.effects.sneezing.enabled = "false" | ConvertFrom-Json
Save the file out. It looks like the default for this doesn’t go deep enough, so some values got truncated. It looks like it uses depth=3, but 4 looks okay. Just in case I used 5, as a higher number has no adverse effects.
$json | ConvertTo-Json -Depth 5 | Out-File .\def_piston_no-sneezing.json