使用 PowerShell 获取 IIS 的特定回收时间

Get Specific Recycling Time For IIS With PowerShell

我正在尝试查找我的应用程序池设置为使用 PowerShell 在我的服务器上回收的具体时间。我知道它设置为每天凌晨 1 点在我正在查看的测试服务器上回收。我是 运行宁:

Get-ItemProperty -Path IIS:\AppPools\AppPool -Name recycling.periodicRestart.time

显示的值为 00:00:00

出于测试目的,我尝试 运行:

Set-ItemProperty -Path IIS:\AppPools\AppPool -Name recycling.periodicRestart.time -Value 3.00:00:00

我查看了这有何变化。 "Specific Time(s)" 字段仍显示为 1:00 上午,但现在 "Regular Time Intervals (in minutes)" 设置为 4320 分钟。很明显我看到的是错误的值...知道如何查看 "Specific Time" 字段中的值吗?

给你:

Set-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule -Value @{value = '03:00:00'}

通过以下方式获取:

Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection