2017-03-17 33 views
0

我使用的是帶有IIS 7.5的Powershell 5.0.10586.117。如何使用Powershell獲取IIS應用程序池的「週期性重新啓動回收值」

當運行

Get-ItemProperty ($singleAppPool) -Name Recycling.periodicRestart.schedule.collection 

我收到即

DefaultAppPool 
value   : 03:00:00 
Attributes  : {Microsoft.IIs.PowerShell.Framework.ConfigurationAttribute} 
ChildElements : {} 
ElementTagName : add 
Methods  : 
Schema   : Microsoft.IIs.PowerShell.Framework.ConfigurationElementSchema 

但我只想要得到的。但是

Get-ItemProperty ($singleAppPool) -Name Recycling.periodicRestart.schedule.collection 

失敗並顯示「未找到」錯誤消息。

如何才能獲得價值只在這裏?

爲了能夠再現使用

Import-Module WebAdministration 

在開始的緣故。

回答

0

如果按你的例子​​命令的作品,你可以得到的價值屬性是這樣的:

(Get-ItemProperty ($singleAppPool) -Name Recycling.periodicRestart.schedule.collection).Value 

我不能診斷爲什麼你會得到一個「未找到」錯誤消息沒有你分享的錯誤或不知道$ singleAppPool中的內容,或者如果這是您服務器上的有效項目。

相關問題