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>

이 cmdlet은 일반 매개 변수 -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer 및 -OutVariable을 지원합니다. 자세한 내용은 다음을 참조하세요. about_CommonParameters(https://go.microsoft.com/fwlink/p/?LinkID=113216).

입력

입력 유형은 cmdlet에 파이프할 수 있는 개체의 유형입니다.

출력

출력 유형은 cmdlet이 내보내는 개체의 유형입니다.

예제

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