I’ve noticed when viewing PSAppDeploy logs in the CMTrace format, the component, date/time and thread columns do not populate information.
Further research has pointed me to an issue with how the time tag is written. I’m in the PST timezone, PSAppDeploy writes the time tag as:
<time=“10:49:09.135-480”
However, if I look at regular CCM logs produced by SCCM, the time tag is written as:
<time=“10:49:09.135+480”
Indeed if I manually modify the PSAppDeploy logs to find/replace all ‘-480’ with +480 and save the changes, full details are then displayed in CMTrace.
This is not a huge issue for me, but I thought I would bring this to the attention of the developers in case anyone else is also seeing the same in their logs.
Ok, yup, that was the problem. I had an old copy of CMTrace. After replacing with the latest version, I can now see full details in the PSAppDeploy logs.
This is still happening in 3.9.0.
And the issue comes from the way the timestamp is created by the Write-Log function.
A working version of the time stamp, from SCCM logs, looks like this:
<time=“11:54:29.015-120”
While PSADT Write-Log function writes the time like this:
<time=“10:13:16.107”
Well, it looks like that change is not enough. Now, I am getting this in the logs:
<time=“00:21:25.412-” date=“01-24-2023”
I pasted the code in the screenshot above directly in PowerShell and it works:
It looks like, for some reason, using Test-Path to see if the variable exists or not fails, at least for me.
And the ‘-’ is also needed in building the $LogTimePlusBias variable.