title: Powershell - Enable 'Directory Browsing' on Physical Folder in IIS6
body: <p>I need a powershell script to enable 'Directory Browsing' on a physical folder in IIS6.  The key is that the folder I would like to modify is a subfolder of another physical folder.  Neither folder is a "virtual directory". </p>
  
  <p>I tried the following, but the DirectoryEntry is empty.  I assume that's because the folder is not a "virtual directory" .</p>
  
  <pre><code>$oDir = New-Object System.DirectoryServices.DirectoryEntry("IIS://localhost/W3SVC/1/Root/Test/Upgrade")
  
  # Loop thru all even though there should only be one...
  foreach ($oDirEntry in $oDir)
  {
     Write-Host "Enabling Directory Browsing on IIS folder [" $oDirEntry.Name "]."
     $oDirEntry.put("EnableDirBrowsing",$true)
     $oDirEntry.psbase.CommitChanges()        
  }
  </code></pre>