【问题标题】:How to get the "periodic restart recycle value" of an IIS Application Pool using Powershell如何使用 Powershell 获取 IIS 应用程序池的“定期重启回收值”
【发布时间】:2017-08-08 21:31:16
【问题描述】:

我正在使用带有 IIS 7.5 的 Powershell 5.0.10586.117。

运行时

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

一开始。

【问题讨论】:

    标签: powershell iis iis-7.5 application-pool


    【解决方案1】:

    如果命令按照您的示例运行,您可以像这样获取 value 属性:

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

    如果您不分享错误或不知道 $singleAppPool 中的内容或您的服务器上的有效项目是否为有效项目,我无法诊断您收到“未找到”错误消息的原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-20
      • 2011-05-05
      • 2015-03-30
      相关资源
      最近更新 更多