Created
February 18, 2014 15:39
-
-
Save grenade/9073300 to your computer and use it in GitHub Desktop.
Poke an xml file and change it's values.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param ( | |
| [hashtable] $pokes, | |
| [string] $config | |
| ) | |
| $xml = (Get-Content $config) -as [xml] | |
| foreach($xpath in $($pokes.Keys)){ | |
| $xml.SelectSingleNode($xpath).set_InnerXML($pokes[$xpath]) | |
| } | |
| $xml.Save($config) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment