I have an xml file where I need to search for the string "plugin_name1" and then change the value for that plugin from 1 to 0. I'm using Select-String in PowerShell to find the string and return the previous 2 lines. I'm having trouble figuring out how to change the value from 1 to 0 on the first 2 output line below.
Note...the string EnableX and EnableY appear throughout the file, so I need to search specifically on the string "plugin_name1".
Also, I need to make the modification on about 100 workstations. The rest of the file varies from station to station but these 4 lines should all the same.
Any suggestions?
Thanks!
PS C:\> Select-String -Path "C:\file.xml" -Pattern "plugin_name1" -Context 2, 0
C:\file.xml:95:<EnableX>1</EnableX>
C:\file.xml:96:<EnableY>1</EnableY>
> C:\file.xml:97:<PluginName>plugin_name1</PluginName>
> C:\file.xml:98:<Name>plugin_name1</Name>