New-PefTraceSession

New-PefTraceSession

Creates a PEF Trace Session.

構文

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>]

詳細説明

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.

パラメーター

-Filter<String>

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

エイリアス

none

必須?

false

位置は?

2

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-InformationAction<System.Management.Automation.ActionPreference>

Specifies how this cmdlet responds to an information event. このパラメーターに対して使用できる値:

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

エイリアス

infa

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-InformationVariable<System.String>

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

エイリアス

iv

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Mode<PEFSessionMode>

Specifies a mode for the Trace Session. このパラメーターに対して使用できる値:

-- 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.

エイリアス

none

必須?

false

位置は?

1

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

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.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

-Silent

Indicates that the cmdlet shows no output.

エイリアス

none

必須?

false

位置は?

named

既定値

none

パイプライン入力を許可する

false

ワイルドカード文字を許可する

false

<CommonParameters>

このコマンドレットは次の共通パラメーターをサポートします。-Verbose、-Debug、-ErrorAction、-ErrorVariable、-OutBuffer、-OutVariable.詳細については、以下を参照してください。 about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216)。

入力

入力型は、コマンドレットにパイプできるオブジェクトの型です。

出力

出力型は、コマンドレットによって生成されるオブジェクトの型です。

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

関連トピック

Start-PefTraceSession

Stop-PefTraceSession

Add-PefMessageSource

New-PefKeyDownTrigger