Skip to content

Instantly share code, notes, and snippets.

@altrive
Created January 6, 2016 20:33
Show Gist options
  • Save altrive/29f51eda774c335b53f4 to your computer and use it in GitHub Desktop.
Save altrive/29f51eda774c335b53f4 to your computer and use it in GitHub Desktop.
GetTraceProviderList sample
#Get-EtwTraceProvider Cmdlet don't return ProviderName
#and some providers returns invalid guid? (invalid parentheses pair)
# Error at: {E02A841C-75A3-4FA7-AFC8-AE09CF9B7F23)
Get-EtwTraceProvider | foreach{ $_.guid;[Guid]::Parse($_.guid)}
Use-NuGetPackage 'Microsoft.Diagnostics.Tracing.TraceEvent' -Verbose #Reuire PSNuget<https://github.com/altrive/PSNuGet>
#$providers = [Microsoft.Diagnostics.Tracing.Session.TraceEventProviders]::GetRegisteredOrEnabledProviders()
$providers = [Microsoft.Diagnostics.Tracing.Session.TraceEventProviders]::GetPublishedProviders()
$providers | foreach {
[pscustomobject] @{
Name = [Microsoft.Diagnostics.Tracing.Session.TraceEventProviders]::GetProviderName($_)
Guid = $_
}
} | sort Name | Out-GridView
#show logman command results
#logman query providers| Out-GridView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment