Write-Log include milliseconds

Is there a setting that I can configure PSADT to also log by the milliseconds so that in the PSADT install logs I’ll see HH:MM:SS.MS rather than just HH:MM:SS?

The Write-log function already does Milliseconds:

        [DateTime]$DateTimeNow = Get-Date
        [String]$LogTime = $DateTimeNow.ToString('HH\:mm\:ss.fff')
        [String]$LogDate = $DateTimeNow.ToString('MM-dd-yyyy')

Ah so I guess my problem is that I was just looking at the logs in CMTrace, which only shows HH:mm:ss.


When I look at the log in Notepad++ I see that it does show milliseconds.

For the milliseconds, what exactly does it mean? For example for the first time stamp in the image I posted 12:19:24.673-420 Is this saying that the event it is logging started at hour 12, minute 19, second 24, millisecond 673 and lasted for 420 milliseconds? Or is it saying that it started at 673 milliseconds and lasted until 420 milliseconds past the next second?

In further review of the timestamps, why do they all end with -420? What does that mean?

12:19:24.673-420
12:19:24.784-420
12:19:24:795-420
12:19:24.856-420
12:19:24.903-420

The -420 is for the TimeZone

-420 ÷ 60 minutes = -7 hours

TimeZone UTC-7 is Mountain Time unless you use Daylight Savings.

1 Like

Thanks, I appreciate your help!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.