Quantcast
Channel: Hey, Scripting Guy! Blog
Viewing all articles
Browse latest Browse all 3333

PowerTip: Use PowerShell to Edit XML File

$
0
0

Summary: Use Windows PowerShell to load an XML file for easy editing.

Hey, Scripting Guy! Question Hey Scripting Guy! Is there an easy way to load and edit an XML file in Windows PowerShell?

Hey, Scripting Guy! Answer It’s so easy that you might miss it if you blink. Create an XML object. With that, you can load, save, and edit properties directly:

$XMLfile=NEW-OBJECT XML

$XMLfile=load(“MyXMLFile.XML”)

$XMLFile.property.otherproperty=”Gibberish”

$XMLFile.save(“MyXMLFile.XML”)


Viewing all articles
Browse latest Browse all 3333

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>