If I wanted to find the directory associated with an IIS site or application, how would I do that?
I cannot seem to find anything on any properties of objects from Get-Website
and Get-WebApplication
that allow me to do so.
Just look at the members of a web site:
get-website -Name "Default Web Site" | Get-Member
returns:
...
password NoteProperty System.String password=
physicalPath NoteProperty System.String physicalPath=%SystemDrive%\inetpub\wwwroot
serverAutoStart NoteProperty System.Boolean serverAutoStart=True
...
that's pretty obvious to me:
(Get-Website -Name "Default Web Site").PhysicalPath
same for an Application:
(get-webapplication foo).PhysicalPath
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With