Ever wondered how to convert the WMI datetime format into a readable date?
Here is an example:
The [System.Management.ManagementDateTimeConverter] type has a static method called toDateTime() which converts WMI datetime to real datetime. The type has additional methods to also convert dates to WMI dates.
$id = Read-Host "Event-ID (i.e. 1001)"get-wmiobject Win32_NTLogEvent -filter "LogFile='Application' and EventCode=$id" | Format-Table Computername, {[System.Management.ManagementDateTimeConverter]::ToDateTime($_.TimeWritten) } , Eventtype, Message