< Back

Get-DbaPfDataCollectorSetTemplate

Mon Jan 13, 2020 11:26 am

NAME Get-DbaPfDataCollectorSetTemplate



SYNOPSIS

Parses Perf Monitor templates. Defaults to parsing templates in the dbatools template repository

(\\bin\\perfmontemplates\\).





SYNTAX

Get-DbaPfDataCollectorSetTemplate [[-Path] <System.String[]>] [[-Pattern] <String>] [[-Template]

<System.String[]>] [-EnableException <Switch>] [<CommonParameters>]





DESCRIPTION

Parses Perf Monitor XML templates. Defaults to parsing templates in the dbatools template repository

(\\bin\\perfmontemplates\\).





PARAMETERS

-EnableException [<Switch>]

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.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Path [<System.String[]>]

The path to the template directory. Defaults to the dbatools template repository (\\bin\\perfmontemplates\\).



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Pattern [<String>]

Specify a pattern for filtering. Alternatively, you can use Out-GridView -Passthru to select objects and pipe

them to Import-DbaPfDataCollectorSetTemplate.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



-Template [<System.String[]>]

Specifies one or more of the templates provided by dbatools. Press tab to cycle through the list to the

options.



Required? false

Position? named

Default value

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Performance, DataCollector, PerfCounter

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Get-DbaPfDataCollectorSetTemplate



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

-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Get-DbaPfDataCollectorSetTemplate | Out-GridView -PassThru | Import-DbaPfDataCollectorSetTemplate

-ComputerName sql2017 | Start-DbaPfDataCollectorSet



Allows you to select a template, then deploys it to sql2017 and immediately starts the DataCollectorSet.

-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Get-DbaPfDataCollectorSetTemplate | Select-Object *



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



RELATED LINKS

https://dbatools.io/Get-DbaPfDataCollectorSetTemplate