Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Reply To: Converting WMI Date and Time

$
0
0

You’ll have to loop them, but all WMI objects in PowerShell have a helper method, so you don’t necessarily need to use that class. Assuming $var contains a property MyDate:

foreach ($thing in $var) { $var.ConvertToDateTime($var.mydate) }

In v3+, you can also switch to using CIM – those tend to return a normal DateTime rather than the underlying WMI weirdo date.


Viewing all articles
Browse latest Browse all 13067

Trending Articles