Skip to content

Commit 44cbd80

Browse files
committed
Set a small header for CM/Event log
1 parent 991b14d commit 44cbd80

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,17 @@ function Write-ToLog {
116116
$StandardLogLine = "$FormattedDate $LogMsg"
117117

118118
# If header requested, format and write to console and standard log file
119-
# Note: The header is not written to the CM log file or Event log, as it is not in the correct format
119+
# Note: The big header is not written to the CM log file or Event log, as it is not in the correct format
120120
if ($IsHeader) {
121121
$Log = "#" * 65 + "`n# $(Get-Date -Format (Get-culture).DateTimeFormat.ShortDatePattern) - $LogMsg`n" + "#" * 65
122122
Write-Host $Log -ForegroundColor $LogColor
123-
#Write log to file
123+
# Write log to file
124124
$Log | Out-File -FilePath $StandardLogFile -Append
125+
126+
# Set a small header for CM/Event log
127+
if ($UseCMLog -or $UseEventLog) {
128+
$LogMsg = "### $LogMsg ###"
129+
}
125130
}
126131
else {
127132
Write-Host $StandardLogLine -ForegroundColor $LogColor

0 commit comments

Comments
 (0)