File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 10
10
. PARAMETER FailureString
11
11
The string used to determine when the OS Upgrade failed.
12
12
. 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.
14
16
#>
15
17
[CmdletBinding ()]
16
18
param (
17
19
[System.IO.FileInfo ]$LogPath = " $env: WINDIR \CCM\Logs\Smstslog" ,
18
20
[System.IO.FileInfo ]$LogFile = ' smsts.log' ,
19
21
[string ]$FailureString = ' Task sequence execution failed with error code' ,
20
- [string ]$Source = ' InPlaceUpgrade'
22
+ [string ]$Source = ' InPlaceUpgrade' ,
23
+ [string ]$EntryType = ' Information'
21
24
)
22
25
23
26
# Create Log Source if necessary
@@ -39,7 +42,7 @@ if (-not (Test-Path $log)) {
39
42
40
43
# Strip the CMTRACE loginfo from the log file. Logs are wrapped in
41
44
# <!\[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.
43
46
try {
44
47
$formatted_log = Get-Content $log - Raw |
45
48
ForEach-Object { $_ -replace ' <!\[LOG\[' , ' ' } |
68
71
$params = @ {
69
72
LogName = ' Application'
70
73
Source = $Source
71
- EntryType = ' Information '
74
+ EntryType = $EntryType
72
75
EventId = 1337
73
76
Message = $formatted_log
74
77
}
You can’t perform that action at this time.
0 commit comments