-4

I have an XML file and need to change the value to False. Is there a way to do this with powershell?

<setting name="RecordChatHistory">
    <value>True</value>
  </setting>

1 Answers1

2

You can do it this way.

  1. Loading xml

    $xml = [xml](Get-Content -Path C:\path\to\file.xml)

  2. Replacing string value True to False

    $xml.setting.value = 'False'

  3. Using the Save() method

    $xml.Save("C:\path\to\file.xml")

zorski
  • 21