Skip to content

Instantly share code, notes, and snippets.

@grenade
Last active August 29, 2015 13:56
Show Gist options
  • Save grenade/9002456 to your computer and use it in GitHub Desktop.
Save grenade/9002456 to your computer and use it in GitHub Desktop.
param(
[string] $archive,
[string] $binding = "*:80:"
)
$xml = [xml] (Get-Content $archive)
if ($xml.SelectSingleNode("//bindings/binding") -and !$xml.SelectSingleNode("//bindings/binding[@bindingInformation='$binding']")) {
$xml.SelectSingleNode("//bindings").AppendChild($xml.SelectSingleNode("//bindings/binding").Clone())
$xml.SelectSingleNode("//bindings/binding/@bindingInformation").set_InnerXML($binding)
$xml.Save($archive)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment