Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Get-DbaXESessionTemplate on GitHub.
Want to see the Bill Of Health for this command? Check out Get-DbaXESessionTemplate.
Parses Extended Event XML templates. Defaults to parsing templates in the dbatools template repository (/bin/XEtemplates/).
Parses Extended Event XML templates. Defaults to parsing templates in the dbatools template repository (/bin/XEtemplates/).
The default repository contains templates from:
Microsoft's Templates that come with SSMS
Jes Borland's "Everyday Extended Events" presentation and GitHub repository (https://github.com/grrlgeek/extended-events)
Christian Grafe (@ChrGraefe) XE Repo: https://github.com/chrgraefe/sqlscripts/blob/master/XE-Events/
Erin Stellato's Blog: https://www.sqlskills.com/blogs/erin/
Some profile templates converted using:
sp_SQLskills_ConvertTraceToExtendedEvents.sql
Jonathan M. Kehayias, SQLskills.com
http://sqlskills.com/blogs/jonathan
Get-DbaXESessionTemplate
[[-Path] <String[]>]
[[-Pattern] <String>]
[[-Template] <String[]>]
[-EnableException]
[<CommonParameters>]
PS C:\> Get-DbaXESessionTemplate
Returns information about all the templates in the local dbatools repository.
PS C:\> Get-DbaXESessionTemplate | Out-GridView -PassThru | Import-DbaXESessionTemplate -SqlInstance sql2017 | Start-DbaXESession
Allows you to select a Session template, then import it to the specified instance and start the session.
PS C:\> Get-DbaXESessionTemplate -Path "$home\Documents\SQL Server Management Studio\Templates\XEventTemplates"
Returns information about all the templates in your local XEventTemplates repository.
PS C:\> Get-DbaXESessionTemplate -Pattern duration
Returns information about all the templates that match the word "duration" in the title, category or body.
PS C:\> Get-DbaXESessionTemplate | Select-Object *
Returns more information about the template, including the full path/filename.
The path to the template directory. Defaults to the dbatools template repository (/bin/XEtemplates/).
Alias | |
Required | False |
Pipeline | false |
Default Value | "$script:PSModuleRoot\bin\XEtemplates" |
Specify a pattern for filtering. Alternatively, you can use Out-GridView -Passthru to select objects and pipe them to Import-DbaXESessionTemplate
Alias | |
Required | False |
Pipeline | false |
Default Value |
Specifies one or more of the templates provided by dbatools. Press tab to cycle through the list of options.
Alias | |
Required | False |
Pipeline | false |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |