Skip to content

Instantly share code, notes, and snippets.

@iandesj
Last active August 25, 2016 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iandesj/78fbf9136f3594521cd0624c390a8d56 to your computer and use it in GitHub Desktop.
Save iandesj/78fbf9136f3594521cd0624c390a8d56 to your computer and use it in GitHub Desktop.
xml manip
$file_path = "C:\the_xml.xml"
$xml = [xml](Get-Content $file_path)
$xml.User.Role.value # retrieve value from <User><Role value="foobar"></User></Role>
$xml.User.Role.value = "lets update this" # change the contents of value
# lots of other cool stuff
$xml.save($file_path) # then save it, like a champ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment