Skip to content

Commit 0bfcf00

Browse files
Update Start-ScomETLTrace.ps1
1 parent 61832f4 commit 0bfcf00

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

Powershell/SCOM ETL Trace/Start-ScomETLTrace.ps1

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
7171
.NOTES
7272
.AUTHOR
73-
Blake Drumm (https://github.com/v-bldrum)
73+
Blake Drumm (https://github.com/blakedrumm)
7474
7575
.CREATED
7676
September 3rd 2020
@@ -141,6 +141,12 @@ trap
141141
{
142142
Write-Warning "Encountered an Exception: $_"
143143
}
144+
Write-Host @"
145+
===============================================================
146+
System Center Operations Manager ETL / Network Trace Gathering
147+
===============================================================
148+
149+
"@
144150
Function Start-ETLTrace
145151
{
146152
[CmdletBinding()]
@@ -431,12 +437,14 @@ exit 0
431437
Function Start-ScomETLTrace
432438
{
433439
Time-Stamp
434-
write-host "Stopping any existing Trace(s)" -ForegroundColor DarkCyan -NoNewline
440+
write-host "Stopping any existing Trace(s)" -ForegroundColor DarkCyan
435441
try
436442
{
437-
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StopTracing.cmd`"" -WorkingDirectory $installdir -NoNewWindow -Wait | out-null
443+
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StopTracing.cmd`"" -WorkingDirectory $installdir -Wait | out-null
438444
if ($NetworkTrace)
439445
{
446+
Time-Stamp
447+
write-host " Stopping any existing Network Trace" -ForegroundColor Gray
440448
do { Write-Host "." -NoNewline -ForegroundColor DarkCyan; sleep 1 }
441449
until (Netsh trace stop)
442450
}
@@ -451,8 +459,9 @@ exit 0
451459
{
452460
if (!$VerboseTrace -and !$DebugTrace)
453461
{
454-
$answer = $null
455-
$answer = Read-Host -Prompt "Would you like to perform a Verbose or Debug Trace? (V/D)"
462+
Time-Stamp
463+
Write-Host "No Trace Type Selected (Verbose / Debug), will proceed with Verbose as default." -ForegroundColor DarkGray
464+
$answer = "verbose"
456465
}
457466
if ($VerboseTrace)
458467
{
@@ -508,7 +517,7 @@ exit 0
508517
{
509518
Time-Stamp
510519
write-host "Starting ETL trace at Verbose level" -ForegroundColor Cyan
511-
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StartTracing.cmd`" VER" -WorkingDirectory $installdir -NoNewWindow -Wait | out-null
520+
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StartTracing.cmd`" VER" -WorkingDirectory $installdir -Wait | out-null
512521
#[string] $Out = $ps.StandardOutput.ReadToEnd();
513522
#[void](Invoke-Item "" 'VER' -)
514523
Time-Stamp
@@ -526,7 +535,7 @@ exit 0
526535
{
527536
Time-Stamp
528537
write-host "Starting ETL trace at Debug level" -ForegroundColor Cyan
529-
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StartTracing.cmd`" DBG" -WorkingDirectory $installdir -NoNewWindow -Wait | out-null
538+
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StartTracing.cmd`" DBG" -WorkingDirectory $installdir -Wait | out-null
530539
Time-Stamp
531540
write-host "Process Completed!" -ForegroundColor DarkCyan
532541
}
@@ -599,7 +608,7 @@ exit 0
599608

600609
Time-Stamp
601610
Write-Host "Stopping ETL Trace" -ForegroundColor Cyan
602-
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StopTracing.cmd`"" -WorkingDirectory $installdir -NoNewWindow -Wait | out-null
611+
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\StopTracing.cmd`"" -WorkingDirectory $installdir -Wait | out-null
603612
if ($NetworkTrace)
604613
{
605614
Time-Stamp
@@ -619,7 +628,7 @@ exit 0
619628

620629
#Start-Process -FilePath cmd.exe -ArgumentList '/c', "`"$installdir`\FormatTracing.cmd`"" -WorkingDirectory $installdir -Wait -WorkingDirectory $installdir -NoNewWindow -Wait
621630

622-
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\FormatTracing.cmd`"" -WorkingDirectory $installdir -NoNewWindow -Wait | out-null
631+
Start-Process "$env:SystemRoot\SYSWOW64\cmd.exe" "/c `"$installdir`\FormatTracing.cmd`"" -WorkingDirectory $installdir -Wait | out-null
623632

624633
#Move Files
625634
Time-Stamp

0 commit comments

Comments
 (0)