New-WebVirtualDirectory
New-WebVirtualDirectory
Creates a new virtual directory in IIS.
Syntax
Parameter Set: Default
New-WebVirtualDirectory [-Name] <String> [-Application <String> ] [-Force] [-PhysicalPath <String> ] [-Site <String> ] [ <CommonParameters>]
Detailed Description
Creates a new virtual directory in IIS.
Parameters
-Application<String>
The application under which the virtual directory is created.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Force
Specifies that the user is not prompted for confirmation.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
false |
Accept Wildcard Characters? |
false |
-Name<String>
The name of the virtual directory to create.
Aliases |
none |
Required? |
true |
Position? |
1 |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-PhysicalPath<String>
The physical path to the folder in which the new virtual directory is created. The specified folder must already exist.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
-Site<String>
The site name under which the virtual directory is created.
Aliases |
none |
Required? |
false |
Position? |
named |
Default Value |
none |
Accept Pipeline Input? |
true (ByPropertyName) |
Accept Wildcard Characters? |
false |
<CommonParameters>
This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).
Inputs
The input type is the type of the objects that you can pipe to the cmdlet.
Outputs
The output type is the type of the objects that the cmdlet emits.
Examples
-------------- EXAMPLE 1: Creating a Virtual Directory --------------
The example creates a new virtual directory named "ContosoVDir" on the Default Web Site.
IIS:\>New-WebVirtualDirectory -Site "Default Web Site" -Name ContosoVDir -PhysicalPath c:\inetpub\contoso