I've parsed the XML file and I have these strings. So, I need to replace the GUID "{87440A4C-1FE4-412E-80C3-74E4F97A31B4}" with a new GUID "{BBB7C1EB-B0B0-40F3-B1D0-1F28111C5806}". How can I save XML after these changes?
Strings which I parsed:
C:ProgramDataProgram {87440A4C-1FE4-412E-80C3-74E4F97A31B4}ExtensionsSignal Integrity
C:ProgramDataProgram {87440A4C-1FE4-412E-80C3-74E4F97A31B4}ExtensionsVcs_SVN_Unicode
C:ProgramDataProgram {87440A4C-1FE4-412E-80C3-74E4F97A31B4}ExtensionsMixed Simulation
C:ProgramDataProgram {87440A4C-1FE4-412E-80C3-74E4F97A31B4}ExtensionsSIMetrix
$fileName = "C:empExtensionsExtensionsRegistry.xml"
$xml = [System.Xml.XmlDocument](Get-Content $fileName)
$Xml.Extensions.Item.Path.ForEach{ $_ -replace 'Program {87440A4C-1FE4-412E-80C3-74E4F97A31B4}', "Program {BBB7C1EB-B0B0-40F3-B1D0-1F28111C5806}"}
$Xml.Save($fileName)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…