dir IIS:\AppPools
clearly outputs the Applications assigned to each AppPool under a "Applications" tab.
My problem is I cant seem to select just that property, plus I'm not able to locate it using Get-Member
.
What am I missing?
dir IIS:\AppPools
clearly outputs the Applications assigned to each AppPool under a "Applications" tab.
My problem is I cant seem to select just that property, plus I'm not able to locate it using Get-Member
.
What am I missing?
You can use this syntax to view most available properties and their values on an AppPool:
ls IIS:\AppPools | where {$_.Name -eq "NameOfYourAppPool"}| fl *
As described in this answer to a related question, what looks like a property of an AppPool item as shown by the Get-Item
or Get-Child-Item
commands is actually a calculated column for display purposes. That's why it doesn't show up with Get-Member.
This calculated column uses Get-WebConfigurationProperty
behind the scenes.
To get the web applications for a Pool as web configuration objects you can use this function that I wrote:
filter Get-WebApplicationForPool()
{
$s = $_.Name
$filter = "system.applicationHost/sites/site/application[@applicationPool='$s']"
Push-Location .
Set-Location "IIS:\Sites"
Get-WebConfiguration -filter $filter -PSPath "IIS:\Sites"
Pop-Location
}
Example:
Set-Location IIS:\AppPools
Get-Item "DefaultAppPool" | Get-WebApplicationForPool