Created
May 31, 2016 13:57
-
-
Save george-polevoy/5d7f109560762f9ac42eb7a7a6783789 to your computer and use it in GitHub Desktop.
Parses XML file with urls and sets acl for http bindings. Useful for Visual Studio to debug without admin permissions.
This file contains 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 ( | |
[string]$user | |
) | |
# USAGE: & '.\set-url-acl.ps1' -user domain\user | |
$xmlPath = 'Settings\SomeSettings.xml' | |
[xml]$xml = Get-Content $xmlPath | |
$nodes = Select-Xml "//Services/HttpDispatcher" $xml | |
$nodes | ForEach-Object { | |
Write-Host "http:/*:$($_.Node.ListenAddress)" | |
& netsh http add urlacl url="http://*:$($_.Node.ListenAddress)" user="$($user)" | |
#& netsh http delete urlacl url="http://localhost:$($_.Node.ListenAddress)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment