Hi, I’m new to working with Powershell and would appreciate some help with extracting the element from an XML file and then output this to a txt file using powershell.
<?xml version="1.0" encoding="utf-8"?> <Generic version="1.0.0"> <ValueId>12345678</ValueId> <ServerIP>127.0.0.1</ServerIP> </Generic>I've been able to extract the value 12345678 to a file using this powershell;$XML = [XML](Get-Content C:\source.xml) $XML.Generic.ValueId | Out-File C:\output.txtI'm struggling to get this exact <ValueId>12345678</ValueId> output to the output.txt Thanks