New-PefTraceSession

New-PefTraceSession

Creates a PEF Trace Session.

Sintaxis

Parameter Set: Default
New-PefTraceSession [[-Mode] <PEFSessionMode> {Circular | Linear} ] [[-Filter] <String> ] [-InformationAction <System.Management.Automation.ActionPreference> {SilentlyContinue | Stop | Continue | Inquire | Ignore | Suspend} ] [-InformationVariable <System.String> ] [-Name <String> ] [-SaveAsParsed] [-SaveOnStop] [-Silent] [ <CommonParameters>]

Descripción detallada

The New-PefTraceSession cmdlet creates a Protocol Engineering Framework (PEF) Trace Session to capture live data or to load message data from saved trace files or logs. This cmdlet enables you to specify a mode, either Circular or Linear, to control how much data the Trace Session holds. You can also specify a filter that selects specific types of messages during data retrieval, either from a Live Trace Session or from saved files and logs. Use the SaveOnStop parameter to save a data collection to a file when the Trace Session stops.

You can use the Add-PefMessageSource cmdlet to specify a message provider for a capture session.

After you create a Trace Session object, use the Start-PefTraceSession and Stop-PefTraceSession cmdlets to define how the session will start and stop collecting message data.

You need to be a member of the Message Capture Users Group and the Performance Log Users Group.

Parámetros

-Filter<String>

Specifies a string that configures a Trace Filter, which defines the types of messages that a Trace Session retrieves.

Alias

none

¿Requerido?

false

¿Posición?

2

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-InformationAction<System.Management.Automation.ActionPreference>

Specifies how this cmdlet responds to an information event. Los valores aceptables para este parámetro son los siguientes:

-- SilentlyContinue
-- Stop
-- Continue
-- Inquire
-- Ignore
-- Suspend

Alias

infa

¿Requerido?

false

¿Posición?

named

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-InformationVariable<System.String>

Specifies a variable in which to store an information event message.

Alias

iv

¿Requerido?

false

¿Posición?

named

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Mode<PEFSessionMode>

Specifies a mode for the Trace Session. Los valores aceptables para este parámetro son los siguientes:

-- Circular. The Trace Session records data until the data size reaches a limit defined by the TotalSize dynamic parameter, and then the session records new data while discarding the oldest recorded data.
-- Linear. The session does not discard data.

The default value for this parameter is Linear.

Alias

none

¿Requerido?

false

¿Posición?

1

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Name<String>

Specifies an input file path. If you use the SaveOnStop parameter, you can specify this parameter to cause the Trace Session to retrieve input data from the specified file.

Alias

none

¿Requerido?

false

¿Posición?

named

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-SaveAsParsed

Indicates that the cmdlet parses all messages fully, and saves them as a .matp file. By default, the cmdlet saves trace data as unparsed. The parsed data in a .matp file loads more quickly. The operation of parsing during capture causes the cmdlet to capture data more slowly.

If you specify the Circular value for the Mode parameter, you should not specify the SaveAsParsed parameter.

Alias

none

¿Requerido?

false

¿Posición?

named

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-SaveOnStop

Indicates that the Trace Session saves data when it stops. You can use the Name dynamic parameter to specify a file path for saving the data.

Alias

none

¿Requerido?

false

¿Posición?

named

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

-Silent

Indicates that the cmdlet shows no output.

Alias

none

¿Requerido?

false

¿Posición?

named

Valor predeterminado

none

¿Aceptar canalización?

false

¿Aceptar caracteres comodín?

false

<CommonParameters>

Este cmdlet admite los siguientes parámetros comunes: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer y -OutVariable. Para obtener más información, consulte about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Entradas

El tipo de entrada es el tipo de los objetos que se pueden canalizar al cmdlet.

Salidas

El tipo de resultado es el tipo de objetos que emite el cmdlet.

Ejemplos

Example 1: Create and run a PEF Trace Session

This example creates and starts a PEF Trace Session.

The first command creates a Trace Session object and stores it in the $TraceSession01 variable. This command specifies the Circular capture mode, with a total size of 50 MB. The command also uses the SaveOnStop parameter and specifies a name for the trace file Trace01.matu, by using the Path parameter, which saves the Trace Session results in the current directory. The command uses the Force parameter, which causes any existing file of the same name to be overwritten when your Trace Session results are saved.

The second command uses the Add-PefMessageSource cmdlet to specify a provider for the Trace Session stored in the $TraceSession01 variable.

The final command uses the Start-PefTraceSession cmdlet to start the Trace Session stored in $TraceSession01.

PS C:\> $TraceSession01 = New-PefTraceSession -Mode Circular -Force -Path "C:\Traces\Trace01.matu" -TotalSize 50 -SaveOnStop
PS C:\> Add-PefMessageSource -PEFSession $TraceSession01 –Source "Microsoft-Pef-WFP-MessageProvider"
PS C:\> Start-PefTraceSession -PEFSession $TraceSession01

Temas relacionados

Start-PefTraceSession

Stop-PefTraceSession

Add-PefMessageSource

New-PefKeyDownTrigger