使用 PowerShell 获取 IIS 的具体回收时间

Chr*_*ass 2 iis powershell time recycle

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

Get-ItemProperty -Path IIS:\AppPools\AppPool -Name recycling.periodicRestart.time
Run Code Online (Sandbox Code Playgroud)

显示的值为 00:00:00

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

Set-ItemProperty -Path IIS:\AppPools\AppPool -Name recycling.periodicRestart.time -Value 3.00:00:00
Run Code Online (Sandbox Code Playgroud)

我检查了一下这是如何改变的。“特定时间”字段仍显示为凌晨 1:00,但现在“常规时间间隔(以分钟为单位)”设置为 4320 分钟。所以显然我正在寻找错误的值...知道如何才能看到“特定时间”字段中的值吗?

Ben*_*rds 5

干得好:

Set-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule -Value @{value = '03:00:00'}
Run Code Online (Sandbox Code Playgroud)

获取它:

Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection
Run Code Online (Sandbox Code Playgroud)