简体   繁体   English

从Powershell获取“特定Times”数组(IIS)的值

[英]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.

相关问题 如何从链接中获取特定值? 电源外壳 - How to get a specific value from a link? Powershell 使用PowerShell获取IIS的特定回收时间 - Get Specific Recycling Time For IIS With PowerShell Powershell XML 从另一个属性中获取具有特定值的属性值 - Powershell XML get attribute value with specific value from another attribute 通过 powershell 或 appcmd 将应用程序池设置为在多个特定时间回收不会在 GUI/IIS 中同时显示 - Setting app pools to recycle at multiple specific times via powershell or appcmd does not display both times in GUI/IIS Powershell:从 integer 数组中查找特定数值的出现次数 - Powershell: Find number of occurrences of a specific numeric value from an integer array 如何从powershell中的一行获取特定值 - How do I get a specific value from a line in powershell 我需要使用 powershell 从 Json 文件中获取特定值 - I need to get a a specific value from Json file using powershell Powershell在特定时间启动 - Powershell launch at specific times PowerShell - 如何从数组中获取 PsObject 属性的值? - PowerShell - How to get the value of PsObject property from an array? 如何从powershell哈希表中获取值作为字符串数组 - How to get the value as an array of strings from powershell hashtable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM