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 "NewSite" -Port 80 -HostHeader "RX-8.srv.world" -PhysicalPath "C:\inetpub\newsite"
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
NewSite 2 Started C:\inetpub\newsite http *:80:RX-8.srv.world
PS C:\Users\Administrator> Get-Website
Name ID State Physical Path Bindings
---- -- ----- ------------- --------
Default Web Site 1 Started %SystemDrive%\inetpub\wwwroot http *:80:
NewSite 2 Started C:\inetpub\newsite http *:80:RX-8.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-8.srv.world
IIS Virtual Host Test Page
|