[英]Get the value of 'specific Times' array (IIS) from powershell
I am trying to retrieve the specific times values from IIS. 我正在尝试从IIS检索特定时间值。 But I get back some sort of reference to a configuration element.
但是我得到了对配置元素的某种引用。
This is for a Microsoft Internet Information Services (version 10.0.14393.0). 这用于Microsoft Internet信息服务(版本10.0.14393.0)。
I tried 我试过了
$itemsInIis = Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection
Write-Host "Times present in IIS: [$itemsInIis]."
I get back Microsoft.IIs.PowerShell.Framework.ConfigurationElement
instead of the actual values. 我找回
Microsoft.IIs.PowerShell.Framework.ConfigurationElement
而不是实际值。 How Should I do this to retrieve the times such as 00:00:00 我应该如何检索诸如00:00:00的时间
NOt sure what I am missing here to retrieve the actual times inside the array. 不确定在这里缺少什么来检索数组中的实际时间。
You are getting back an array of ConfigurationElements, each of which has value
of type TimeSpan
. 您将返回一个ConfigurationElements数组,每个数组的
value
类型为TimeSpan
。 Try something like this: 尝试这样的事情:
$itemsInIis = (Get-ItemProperty -Path IIS:\AppPools\DefaultAppPool -Name recycling.periodicRestart.schedule.collection).value -F 'hhmmsss'
Write-Host "Times present in IIS: [$itemsInIis]."
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.