New-IISSite
Syntax
New-IISSite
-Name <String>
-PhysicalPath <String>
-BindingInformation <String>
[-Protocol <String>]
[-CertificateThumbPrint <String>]
[-SslFlag <SslFlags>]
[-CertStoreLocation <String>]
[-Force]
[-Passthru]
[<CommonParameters>]
Description
The New-IISSite cmdlet is used to create an Internet Information Services (IIS) website with the given physical site as the root and binding information to listen on a specific IP:Port:Hostname binding.
Examples
Example 1: Add a new IIS web site
PS C:\> New-IISSite -Name "TestSite" -BindingInformation "*:8080:" -PhysicalPath "$env:systemdrive\inetpub\testsite"
This command creates a new website named TestSite.
Example 2: Add a new website and set application pool of the site default application to a custom name
PS C:\> Start-IISCommitDelay
PS C:\> $TestSite = New-IISSite -Name TestSite -BindingInformation "*:8080:" -PhysicalPath "$env:systemdrive\inetpub\testsite" -Passthru
PS C:\> $TestSite.Applications["/"].ApplicationPoolName = "TestSiteAppPool"
PS C:\> Stop-IISCommitDelay
This command creates a website named TestSite with default application assigned to the TestSiteAppPool application pool.
Example 3: Add a new website of HTTPS binding
PS C:\> New-IISSite -Name "TestSite" -PhysicalPath "$env:systemdrive\inetpub\testsite" -BindingInformation "*:443:" -CertificateThumbPrint "D043B153FCEFD5011B9C28E186A60B9F13103363" -CertStoreLocation "Cert:\LocalMachine\Webhosting" -Protocol https
This command creates a website named TestSite with HTTPS binding
Required Parameters
Specifies the binding information string to use for the new site. The binding information of the form IP:Port:hostname such as 192.168.0.1:80:www.contoso.com and one or more of the fields can be left blank, which is equivalent to using a wildcard character such as *:443:. In this representation * indicates all IP addresses and all hostnames are indicated by leaving the corresponding field blank.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the name of the IIS website.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the physical path to the new IIS website.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Optional Parameters
Specifies the certificate store path of the certificate, which is used to add a new HTTPS binding
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies a certificate thumbprint, which is used to add a new HTTPS binding
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Forces the command to run without asking for user confirmation.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Returns an object representing the item with which you are working. By default, this cmdlet does not generate any output.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The protocol for which the binding is configured, usually http, https or ftp.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Specifies the SSL flag settings of the new binding.
Type: | SslFlags |
Position: | Named |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Inputs
String
Outputs
Microsoft.Web.Administration.Site