Skip to content

Instantly share code, notes, and snippets.

@dagda1
Created January 4, 2011 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagda1/764478 to your computer and use it in GitHub Desktop.
Save dagda1/764478 to your computer and use it in GitHub Desktop.
function Create-VirtualDir($Parent, $FriendlyName, $VirPath)
{
$newdir = $Parent.Create("IISWebVirtualDir", $FriendlyName)
[Void]$newdir.Put("Path", $VirPath)
[Void]$newdir.Put("AccessRead", $true)
[Void]$newdir.Put("AccessWrite",$true)
[Void]$newdir.Put("AccessScript", $true)
[Void]$newdir.AppCreate2(1)
[Void]$newdir.Put("AppFriendlyName", $FriendlyName)
[Void]$newdir.SetInfo()
return $newdir
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment