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

New-WebVirtualDirectory

Last Updated: 4/3/2017

SYNOPSIS

Creates a virtual directory in IIS.

SYNTAX

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.

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
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

-Name

Specifies the name of the new virtual directory.

Type: String
Parameter Sets: (All)
Aliases: 

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

-PhysicalPath

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

Type: String
Parameter Sets: (All)
Aliases: 

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

-Site

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

Type: String
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
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-WebVirtualDirectory

Remove-WebVirtualDirectory

© 2017 Microsoft