commands

^

Export-DbaXECsv

Author Gianluca Sartori (@spaghettidba)
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Export-DbaXECsv on GitHub.
Want to see the Bill Of Health for this command? Check out Export-DbaXECsv.

Synopsis

Exports Extended Events to a CSV file.

Description

Exports Extended Events to a CSV file.

Syntax

Export-DbaXECsv
    [-InputObject] <Object[]>
    [[-Path] <String>]
    [[-FilePath] <String>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-ChildItem -Path C:\temp\sample.xel | Export-DbaXECsv -Path c:\temp\sample.csv

Writes Extended Events data to the file "C:\temp\events.csv".

Example: 2
PS C:\> Get-DbaXESession -SqlInstance sql2014 -Session deadlocks | Export-DbaXECsv -Path c:\temp\events.csv

Writes Extended Events data to the file "C:\temp\events.csv".

Required Parameters

-InputObject

Allows Piping

Alias FullName
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-Path

Specifies the directory where the file or files will be exported.

Alias
Required False
Pipeline false
Default Value (Get-DbatoolsConfigValue -FullName 'Path.DbatoolsExport')
-FilePath

Specifies the full file path of the output file.

Alias OutFile,FileName
Required False
Pipeline false
Default Value
-EnableException

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