Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
# current Web Sites list
PS C:\Users\Administrator> Get-Website
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
Default Web Site 1 Started %SystemDrive%\inetpub\wwwroot http *:80:
# for example, add [NewSite] Site
# physical path [C:\inetpub\newsite], hostname [rx-8.srv.world]
PS C:\Users\Administrator> mkdir C:\inetpub\newsite
PS C:\Users\Administrator> New-WebSite -Name "RX-7.srv.world" -Port 80 -HostHeader "rx-7.srv.world" -PhysicalPath "C:\inetpub\newsite"
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
RX-7.srv.world 2 Started C:\inetpub\newsite http *:80:rx-7.srv.world
PS C:\Users\Administrator> Get-Website
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
Default Web Site 1 Started %SystemDrive%\inetpub\wwwroot http *:80:
RX-7.srv.world 2 Started C:\inetpub\newsite http *:80:rx-7.srv.world
# create a test page
PS C:\Users\Administrator> Write-Output "IIS Virtual Host Test Page" | Out-File C:\inetpub\newsite\index.html -Encoding Default
# verisy accesses
# default site
PS C:\Users\Administrator> curl.exe localhost
IIS Default Start Page
# new site
PS C:\Users\Administrator> curl.exe rx-7.srv.world
IIS Virtual Host Test Page
|