Edit

Share via


New-WebVirtualDirectory

Creates a virtual directory in IIS.

Syntax

Default (Default)

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

Description

The New-WebVirtualDirectory cmdlet creates a virtual directory in Internet Information Services (IIS).

Examples

Example 1: Create a virtual directory

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

This command creates a virtual directory named ContosoVDir on the default website.

Parameters

-Application

Specifies the name of a web application under which this cmdlet creates the virtual directory.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Force

Forces the command to run without asking for user confirmation.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Name

Specifies the name of the new virtual directory.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-PhysicalPath

Specifies the physical path to the folder in which this cmdlet creates the virtual directory. The specified folder must already exist.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Site

Specifies the name of the site under which this cmdlet creates the virtual directory.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

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