New-WebVirtualDirectory
New-WebVirtualDirectory
Creates a new virtual directory in IIS.
Syntax
New-WebVirtualDirectory [-Site <String>] [-Application <String>] [-Name] <String> [-PhysicalPath <String>] [-Force] [-WarningAction <ActionPreference>] [-WarningVariable <String>] [<CommonParameters>]
Detailed Description
Creates a new virtual directory in IIS.
Parameters
-Site <String>
The site name under which the virtual directory is created.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
named |
-Application <String>
The application under which the virtual directory is created.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
named |
-Name <String>
The name of the virtual directory to create.
Attributes
Name | Value |
---|---|
Required? |
true |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
1 |
-PhysicalPath <String>
The physical path to the folder in which the new virtual directory is created. The specified folder must already exist.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
true (ByPropertyName) |
Position? |
named |
-Force <SwitchParameter>
Specifies that the user is not prompted for confirmation.
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-WarningAction <ActionPreference>
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-WarningVariable <String>
Attributes
Name | Value |
---|---|
Required? |
false |
Accept wildcard characters? |
false |
Accept Pipeline Input? |
false |
Position? |
named |
-CommonParameter
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see About Common Parameter
Input and Return Types
The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet emits.
Input Type |
. |
Return Type |
. |
Notes
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.