70
70
71
71
. NOTES
72
72
.AUTHOR
73
- Blake Drumm (https://github.com/v-bldrum )
73
+ Blake Drumm (https://github.com/blakedrumm )
74
74
75
75
.CREATED
76
76
September 3rd 2020
@@ -141,6 +141,12 @@ trap
141
141
{
142
142
Write-Warning " Encountered an Exception: $_ "
143
143
}
144
+ Write-Host @"
145
+ ===============================================================
146
+ System Center Operations Manager ETL / Network Trace Gathering
147
+ ===============================================================
148
+
149
+ "@
144
150
Function Start-ETLTrace
145
151
{
146
152
[CmdletBinding ()]
@@ -431,12 +437,14 @@ exit 0
431
437
Function Start-ScomETLTrace
432
438
{
433
439
Time- Stamp
434
- write-host " Stopping any existing Trace(s)" - ForegroundColor DarkCyan - NoNewline
440
+ write-host " Stopping any existing Trace(s)" - ForegroundColor DarkCyan
435
441
try
436
442
{
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
438
444
if ($NetworkTrace )
439
445
{
446
+ Time- Stamp
447
+ write-host " Stopping any existing Network Trace" - ForegroundColor Gray
440
448
do { Write-Host " ." - NoNewline - ForegroundColor DarkCyan; sleep 1 }
441
449
until (Netsh trace stop)
442
450
}
@@ -451,8 +459,9 @@ exit 0
451
459
{
452
460
if (! $VerboseTrace -and ! $DebugTrace )
453
461
{
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"
456
465
}
457
466
if ($VerboseTrace )
458
467
{
@@ -508,7 +517,7 @@ exit 0
508
517
{
509
518
Time- Stamp
510
519
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
512
521
# [string] $Out = $ps.StandardOutput.ReadToEnd();
513
522
# [void](Invoke-Item "" 'VER' -)
514
523
Time- Stamp
@@ -526,7 +535,7 @@ exit 0
526
535
{
527
536
Time- Stamp
528
537
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
530
539
Time- Stamp
531
540
write-host " Process Completed!" - ForegroundColor DarkCyan
532
541
}
@@ -599,7 +608,7 @@ exit 0
599
608
600
609
Time- Stamp
601
610
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
603
612
if ($NetworkTrace )
604
613
{
605
614
Time- Stamp
@@ -619,7 +628,7 @@ exit 0
619
628
620
629
# Start-Process -FilePath cmd.exe -ArgumentList '/c', "`"$installdir`\FormatTracing.cmd`"" -WorkingDirectory $installdir -Wait -WorkingDirectory $installdir -NoNewWindow -Wait
621
630
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
623
632
624
633
# Move Files
625
634
Time- Stamp
0 commit comments