Skip to content

Commit 2544fdc

Browse files
committed
Specify default entrytype
1 parent 649d94e commit 2544fdc

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

SCCMLogs/Write-SCCMLogs.ps1

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
.PARAMETER FailureString
1111
The string used to determine when the OS Upgrade failed.
1212
.PARAMETER Source
13-
Specifies the event log source for writing logs.
13+
Specifies the Event Log source for writing logs.
14+
.PARAMETER EntryType
15+
Specifies the Event Log entry type for writing logs.
1416
#>
1517
[CmdletBinding()]
1618
param (
1719
[System.IO.FileInfo]$LogPath = "$env:WINDIR\CCM\Logs\Smstslog",
1820
[System.IO.FileInfo]$LogFile = 'smsts.log',
1921
[string]$FailureString = 'Task sequence execution failed with error code',
20-
[string]$Source = 'InPlaceUpgrade'
22+
[string]$Source = 'InPlaceUpgrade',
23+
[string]$EntryType = 'Information'
2124
)
2225

2326
# Create Log Source if necessary
@@ -39,7 +42,7 @@ if (-not (Test-Path $log)) {
3942

4043
# Strip the CMTRACE loginfo from the log file. Logs are wrapped in
4144
# <!\[LOG\[ DATA \]LOG\]!>. All we want is the DATA. Also helps keep
42-
# under the 32KB limit for event log messages.
45+
# under the 32KB limit for Event Log messages.
4346
try {
4447
$formatted_log = Get-Content $log -Raw |
4548
ForEach-Object { $_ -replace '<!\[LOG\[', '' } |
@@ -68,7 +71,7 @@ try {
6871
$params = @{
6972
LogName = 'Application'
7073
Source = $Source
71-
EntryType = 'Information'
74+
EntryType = $EntryType
7275
EventId = 1337
7376
Message = $formatted_log
7477
}

0 commit comments

Comments
 (0)