Table of contents
TLS
TOC
Collapse the table of content
Expand the table of content

ConvertTo-WebApplication

Brian Lich|Last Updated: 4/3/2017

SYNOPSIS

Converts an IIS virtual directory to an IIS web application.

SYNTAX

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

DESCRIPTION

The ConvertTo-WebApplication cmdlet converts an Internet Information Services (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 
IIS:\> New-WebVirtualDirectory -Site "Default Web Site" -Name "ContosoVDir" -PhysicalPath "$Env:systemdrive\inetpub\Contoso" 
IIS:\> ConvertTo-WebApplication -PSPath "IIS:\Sites\Default Web Site\ContosoVDir"

The first command creates a physical directory named Contoso.

The second command creates a virtual directory in IIS that uses that physical directory.

The last command converts the virtual directory to a web application.

PARAMETERS

-ApplicationPool

Specifies the application pool in which the application runs.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
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
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-Force

Forces the command to run without asking for user confirmation.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
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 the format IIS:\sites\Default Web Site.

Type: String[]
Parameter Sets: (All)
Aliases: 

Required: False
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
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

Get-WebApplication

New-WebApplication

New-WebVirtualDirectory

Remove-WebApplication

© 2017 Microsoft