2014-10-05 39 views
0

dir IIS:\AppPools在「應用程序」選項卡下清楚地輸出分配給每個AppPool的應用程序。無法從「dir IIS: AppPools」中選擇「應用程序」屬性

我的問題是我似乎無法選擇該屬性,再加上我無法使用Get-Member找到它。

enter image description here

我缺少什麼?

+0

我不是太熟悉IIS,但這些成員似乎是應用程序池中的成員。您是否嘗試過選擇「Item」或「ChildElements」成員? – 2014-10-05 16:04:36

回答

0

你可以使用這個語法來查看一個應用程序池最可用的屬性和值:

ls IIS:\AppPools | where {$_.Name -eq "NameOfYourAppPool"}| fl * 
0

this answer to a related question描述,如圖中的Get-Item或看起來像一個應用程序池項的屬性Get-Child-Item命令實際上是一個用於顯示目的的計算列。這就是爲什麼它不顯示Get-Member。

此計算列在幕後使用Get-WebConfigurationProperty

要獲得一個池的Web應用程序作爲Web配置對象,你可以使用這個功能,我寫道:

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 
} 

例子:

Set-Location IIS:\AppPools 
Get-Item "DefaultAppPool" | Get-WebApplicationForPool 
相關問題