Re:In defense of PowerShell
by switch007 on Monday August 24, 2015 @06:13PM
(#10113204)
Why the colons surrounding the port !?
[ Parent
| on HN ]
Basically you're modifying a string that consists of:
IP Address:Port:Virtual Host
For example: 172.16.1.1:80:www.example.com
The raw values reside in an XML config file called "applicationHost.config" which replaces the old school and rather opaque IIS6 metabase.Admittedly that example is a bit old school, there's better commandlets available now that wrap having to manipulate these string values directly. e.g. the New-WebBinding and Set-WebBinding examples shown in sibling comments in this sub-thread.
A site config looks like:
<site name="MyWebSite" id="3" serverAutoStart="true">
<application path="/" applicationPool="MyWebSite">
<virtualDirectory path="/" physicalPath="D:\websites\mywebsite\www" />
</application>
<bindings>
<binding protocol="http" bindingInformation="172.16.1.1:80:example.com" />
<binding protocol="http" bindingInformation="172.16.1.1:80:www.example.com" />
<binding protocol="https" bindingInformation="172.16.1.:443:" />
</bindings>
</site>
None of this is particularly mysterious, and the documentation is pretty good.