I am currently using the Converttodatetime( ) method, is there any way to use the ToShortTimeString() , im not opposed to builidng a hash table with that method either . im looking for just the Time no seconds .eg 11:00
Ill be using this rt do some conditional html formatting
[xml]$html = $Reboot | ConvertTo-Html -fragment
#check each row, skipping the TH header row
for ($i=1;$i -le $html.table.tr.count-1;$i++) {
$class = $html.CreateAttribute("class")
#check the value of the last column and assign a class to the row
if (($html.table.tr[$i].td[-1] -as [datetime]) -notlike '*11:00*') {
$class.value = "danger"
$html.table.tr[$i].Attributes.Append($class) | Out-Null
}
}
Also, if you query the class using Get-CimInstance, you’ll get a DateTime by default.
For future posts, please try not to reply to your own post. A lot of us look for “topics without a reply” as a way of finding posts that need answered; when you reply to your own topic, sometimes that keeps your topic from being seen by folks who might be able to help. Instead, try to think about your post and include all the needed information up front. You can edit the original post to add more information, if something occurs to you before someone is able to reply. Thanks.