Useful way to edit the ServiceConfig.json file in bulk using PowerShell #946
chadbaldwin
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I needed to update 90 instance configurations to add TableSize collection settings. So I threw together this script and thought I would share.
By using
Add-Member ... -Force
it will add or overwrite the member if it exists.At the end, the contents is copied to the clipboard because I like to paste the contents into WinMerge to compare the current file with the new contents. Fortunately, PowerShell seems to format the JSON in the same way that the DBADashConfigTool does, so it's a pretty clean compare.
And unfortunately,
-Depth 100
is necessary because PowerShell is weird and flattens objects in JSON if you don't specify that.Beta Was this translation helpful? Give feedback.
All reactions