New-WebVirtualDirectory

Creates a new virtual directory in IIS.

Syntax

New-WebVirtualDirectory
   [-Site <String>]
   [-Application <String>]
   [-Name] <String>
   [-PhysicalPath <String>]
   [-Force]
   [<CommonParameters>]

Description

Creates a new virtual directory in IIS.

Examples

-------------- EXAMPLE 1: Creating a Virtual Directory --------------

IIS:\>New-WebVirtualDirectory -Site "Default Web Site" -Name ContosoVDir -PhysicalPath c:\inetpub\contoso

The example creates a new virtual directory named "ContosoVDir" on the Default Web Site.

Required Parameters

-Name

The name of the virtual directory to create.

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

Optional Parameters

-Application

The application under which the virtual directory is created.

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

Specifies that the user is not prompted for confirmation.

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

The physical path to the folder in which the new virtual directory is created. The specified folder must already exist.

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

The site name under which the virtual directory is created.

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