Skip to content

Commit 2d6ed62

Browse files
committed
Context for OneTrace in CM log
1 parent a551a5b commit 2d6ed62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Winget-AutoUpdate/functions/Write-ToLog.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ function Write-ToLog {
100100

101101
# Create the log entry in CM format - note the exact format needed for OneTrace
102102
$ComputerName = $env:COMPUTERNAME
103-
$CMLogLine = "<![LOG[$LogMsg]LOG]!><time=`"$time`" date=`"$date`" component=`"$Component`" context=`"`" type=`"$CMLogLevel`" thread=`"$ThreadID`" file=`"$ComputerName`">"
103+
$Context = "Started by:$env:USERNAME"
104+
$CMLogLine = "<![LOG[$LogMsg]LOG]!><time=`"$time`" date=`"$date`" component=`"$Component`" context=`"$Context`" type=`"$CMLogLevel`" thread=`"$ThreadID`" file=`"$ComputerName`">"
104105

105106
# Write to CM log file
106107
$CMLogLine | Out-File -FilePath $CMLogFile -Append

0 commit comments

Comments
 (0)