dbatools is a free PowerShell module with over 300 SQL Server administration, best practice and migration commands included.

Please note that documentation and command names may be out of date while we work furiously towards 1.0


Parses Extended Event XML templates. Defaults to parsing templates in our 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
Christian Gräfe’s XE Repo
Erin Stellato’s Blog

Some profile templates converted using:
Jonathan M. Kehayias, SQLskills.com




Returns information about all the templates in the local dbatools repository.


Allows you to select a Session template then import to an instance named.

Get-DbaXESessionTemplate | Out-GridView -PassThru | Import-DbaXESessionTemplate -SqlInstance sql2017 | Start-DbaXESession

Returns information about all the templates in your local XEventTemplates repository.

Get-DbaXESessionTemplate -Path “$home\Documents\SQL Server Management Studio\Templates\XEventTemplates”

Returns information about all the templates that match the word duration in the title, category or body.

Get-DbaXESessionTemplate -Pattern duration

Returns more information about the template, including the full path/filename.

Get-DbaXESessionTemplate | Select *


This command was created by Chrissy LeMaire. You can find Chrissy on Twitter.


From PowerShell, execute Get-Help Get-DbaXESessionTemplate -Detailed for more information on this function.

Source Code

Want to see the source code? View Get-DbaXESessionTemplate.ps1 on GitHub

Related commands