获取';具体时间';powershell中的阵列(IIS)
我正在尝试从IIS检索特定的时间值。 但是我得到了对配置元素的某种引用 这适用于Microsoft Internet信息服务(版本10.0.14393.0) 我试过了获取';具体时间';powershell中的阵列(IIS),powershell,iis,iis-7,Powershell,Iis,Iis 7,我正在尝试从IIS检索特定的时间值。 但是我得到了对配置元素的某种引用 这适用于Microsoft Internet信息服务(版本10.0.14393.0) 我试过了 $itemsInIis = Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection Write-Host "Times present in IIS: [$itemsInIis].
$itemsInIis = Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection
Write-Host "Times present in IIS: [$itemsInIis]."
我回来了
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
而不是实际值。我应该如何检索时间,例如00:00:00
不确定我在这里缺少什么来检索数组中的实际时间。您将返回一个ConfigurationElements数组,其中每个元素都有
类型TimeSpan
的值。试着这样做:
$itemsInIis = (Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection).value -F 'hhmmsss'
Write-Host "Times present in IIS: [$itemsInIis]."
您可能希望在此处使用HH
而不是HH
来指定24小时时钟,而不是12小时时钟。