CmdID / PowerShell / Cmdlets / Start
Start-Trace
Start an Event Trace logging session. PowerShell reference
From the PowerShell reference 9 parameters
What it does
Start an Event Trace logging session. This cmdlet starts a Windows Event Trace logging session. This cmdlet is used by the following cmdlets: - Enable-PSWSManCombinedTrace - Enable-WSManTrace You must run this cmdlet from an elevated PowerShell session.
Start-Trace [-SessionName] <String> [[-OutputFilePath] <String>] [[-ProviderFilePath] <String>] [-ETS] [-Format <String>] [-MinBuffers <Int32>] [-MaxBuffers <Int32>] [-BufferSizeInKB <Int32>] [-MaxLogFileSizeInMB <Int32>] [<CommonParameters>]
Start a WSMan Trace logging session
$parameters = @{
SessionName = 'wsmlog'
ETS = $true
OutputFilePath = "$Env:windir\system32\wsmtraces.log"
Format = 'bincirc'
MinBuffers = 16
MaxBuffers = 256
BufferSizeInKb = 64
MaxLogFileSizeInMB = 256
ProviderFilePath = "$Env:windir\system32\wsmtraceproviders.txt"
}
Start-Trace @parametersIdentifyIts page in the reference: Start-Trace.
Parameters
-BufferSizeInKBEvent Trace Session buffer size in kilobytes (KB).-ETSSend commands to Event Trace Sessions directly without saving or scheduling.-FormatSpecifies the log format for the data collector. For SQL database format, you must use the OutputFilePath option in the command line with the dsn!log value. The default is binary (bin). The possible values are:
- bin - binary
- bincirc - binary with circular logging
- csv - Comma-separated values
- tsv - Tab-separated values
- sql - SQL database-MaxBuffersSets the maximum number of Event Trace Session buffers.-MaxLogFileSizeInMBSets the maximum log file size in megabytes (MB) or number of records for SQL logs.-MinBuffersSets the minimum number of Event Trace Session buffers.-OutputFilePathPath of the output log file or the DSN and log set name in a SQL database. The default path is
$Env:SystemDrive\PerfLogs\Admin.-ProviderFilePathFile listing multiple Event Trace providers to enable.-SessionNameThe name of the Event Trace session. To stop a trace session you must know the session name.