ConvertTo-WebApplication

Converts an IIS virtual directory to an IIS Web application.

Syntax

ConvertTo-WebApplication
         [-ApplicationPool <String>]
         [-Force]
         [[-PSPath] <String[]>]
         [-WhatIf]
         [-Confirm]
         [<CommonParameters>]

Description

Converts an IIS virtual directory to an IIS Web application.

Examples

-------------- EXAMPLE 1: Convert a Virtual Directory to a Web Application --------------

IIS:\>md $env:systemdrive\inetpub\Contoso New-WebVirtualDirectory -Site "Default Web Site" -Name ContosoVDir -physicalPath $env:systemdrive\inetpub\Contoso ConvertTo-WebApplication "IIS:\Sites\Default Web Site\ContosoVDir"

This example creates a physical directory named "Contoso." It then creates a virtual directory in IIS that uses that physical directory. It then converts the virtual directory to a Web application.

Optional Parameters

-ApplicationPool

The application pool in which the application runs.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-Force

Forces the conversion without prompting you for confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PSPath

Specifies the configuration path. This can be either an IIS configuration path in the format computer name/webroot/apphost, or the IIS module path in this format IIS:\sites\Default Web Site.

Type:String[]
Position:1
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False