![](/img/trans.png)
[英]Recycling IIS application pool using PowerShell: “Exception calling Recycle”
[英]How to get the “periodic restart recycle value” of an IIS Application Pool using Powershell
我正在將Powershell 5.0.10586.117與IIS 7.5配合使用。
跑步時
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
在一開始的時候。
如果該命令按您的示例運行,則可以獲取value屬性,如下所示:
(Get-ItemProperty ($singleAppPool) -Name Recycling.periodicRestart.schedule.collection).Value
如果您不共享錯誤或不知道$ singleAppPool中的內容或服務器上的有效項目,我無法診斷出為什么收到“未找到”錯誤消息。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.