Creating virtual directories and web applications

Virtual directories and web applications are the different options to contain content in IIS. A virtual directory is a pointer to a location on the disk where the content actually resides. A web application, in the IIS terminology, is a virtual directory that also has the ability to run in a different worker process than its parent.

To create a virtual directory, we will use the New-WebVirtualDirectory cmdlet and supply the –Name and –PhysicalPath parameters. Also, we will need to specify the site and we can do this in one of the following two ways:

  1. Use Set-Location (CD) in the IIS drive and navigate to the desired site.
  2. Specify the site on the command line.

In the following screenshot, we will illustrate ...

Get Getting Started with PowerShell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.