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

问题描述 投票:0回答:1

我正在尝试使用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

我查看了这是如何改变的。 “特定时间”字段仍然在凌晨1点读取,但现在“常规时间间隔(以分钟为单位)”设置为4320分钟。所以显然我看错了价值......任何想法我怎么能看到“特定时间”字段中的值?

powershell iis time recycle
1个回答
2
投票

干得好:

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
© www.soinside.com 2019 - 2024. All rights reserved.