Powershell Tip #7: Convert WMI date to Datetime

By | July 10, 2015

Tip: You can convert WMI date (format DTMF Distributed Management Task Force) to DateTime:

convert-wmi-date-to-datetime-with-powershell-wmi

Note: Use CIM cmdlets (available since PowerShell v3) instead of WMI cmdlets, moreover CIM return a more understandable datetime format :
(Get-CimInstance -ClassName Win32_OperatingSystem).InstallDate

MSDN:
ManagementDateTimeConverter.ToDateTime Method


previous-buttonnext-button

Leave a Reply

Your email address will not be published. Required fields are marked *