WMI Date Conversion
USE: To convert the GMT data returned from error logs to a readable date time value.
CLEAR $sHostName = "TUIRA" $aLogName = "Application" $FromDate = [datetime]::today $WMIQuery = "LogFile='$aLogName' and Type='Error' and TimeGenerated>='$FromDate'" Get-WmiObject Win32_NTLogEvent -ComputerName $sHostName ` -Filter "$WMIQuery" ` -ErrorAction SilentlyContinue | ` SELECT SourceName, ` @{Name = "TimeGenerated"; EXPRESSION = {$_.ConvertToDateTime($_.TimeGenerated)}}, ` Message