Hi All,

Back again with one more research of mine,This time it is about creating a virtual directory/web application in IIS using powershell.

I have executed this script in IIS 7.5, Windows 7 32 bit Pro. But, I think it should work with 2008 R2 as well.

Import-Module webadministration Set-Location 'IIS:\Sites\Default Web Site' if (Test-Path '.\Mockups') { Remove-Item '.\Mockups' -Recurse -Force echo 'Mockup Deleted' } New-Item '.\Mockups' -physicalPath 'Y:\Mockups' -type Application Set-Location '.\Mockups' if (Test-Path '.\WebInternal') { Remove-Item '.\WebInternal' -Recurse -Force echo 'WebInternal Deleted' } New-Item '.\WebInternal' -physicalPath 'Y:\Mockups\SourceCode\WebInternal' -type Application if (Test-Path '.\WebExternal') { Remove-Item '.\WebExternal' -Recurse -Force echo 'WebExternal Deleted' } New-Item '.\WebExternal' -physicalPath 'Y:\Mockups\SourceCode\WebExternal' -type Application

First line is important else you would not be able to access the IIS:\ root directory, What this line does is that it imports the web administration module in powershell,

after this first line IIS becomes available to you as a root folder that you can manipulate using commands. Directories that I am trying to create in this are Mockups then under Mockups WebInternal and WebExternal. Please put comments for any questions. Attached is the actual script.

C ya later.