Watch live XEvent Data as it happens – this command runs until you kill the PowerShell session or Ctrl-C.
Shows events for the system_health session as it happens.
Watch-DbaXEventSession -SqlInstance ServerA\sql987 -Session system_health
Also shows events for the system_health session as it happens and expands the Fields property. Looks a bit like this.
Name Type Value
—- —- —–
id System.UInt32 0
timestamp System.UInt64 0
process_utilization System.UInt32 0
system_idle System.UInt32 99
user_mode_time System.UInt64 8906250
kernel_mode_time System.UInt64 468750
page_faults System.UInt32 60
working_set_delta System.Int64 0
memory_utilization System.UInt32 99
Get-DbaXEventSession -SqlInstance sql2016 -Session system_health | Watch-DbaXEventSession | Select -ExpandProperty Fields
This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.