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


Exports a Data Collector Set XML Template from Get-DbaPfDataCollectorSet. Exports to “$home\Documents\Performance Monitor Templates” by default.




Exports all data collector sets from to the C:\temp\pf folder.

Export-DbaPfDataCollectorSetTemplate -ComputerName sql2017 -Path C:\temp\pf

Exports the ‘System Correlation’ data collector set from sql2017 to C:\temp.

Get-DbaPfDataCollectorSet ComputerName sql2017 -CollectorSet ‘System Correlation’ | Export-DbaPfDataCollectorSetTemplate -Path C:\temp


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


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

Source Code

Want to see the source code? View Export-DbaPfDataCollectorSetTemplate.ps1 on GitHub

Related commands