Export (0) Print
Expand All

Save-PefDataCollection

Windows Server 2012 R2 and Windows 8.1

Updated: October 17, 2013

Applies To: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2

Save-PefDataCollection

Saves the data from a PEF Trace Session.

Syntax

Parameter Set: Default
Save-PefDataCollection [-Session] <IPpkTraceSessionEx> [-Path] <String> [-Force] [-SaveAsParsed] [-Trigger <Trigger[]> ] [ <CommonParameters>]




Detailed Description

The Save-PefDataCollection cmdlet creates an action that saves the data collection of a Protocol Engineering Framework (PEF) Trace Session to a file. This cmdlet enables you to specify the Trace Session to be saved and the path to a file in which to save the data collection.

You can also specify a trigger for the save action. When the trigger activates, the save action saves all messages currently contained in the Trace Session.

If you want to save data when the Trace Session stops, specify the SaveOnStop parameter when you create the Trace Session with the New-PefTraceSession cmdlet.

Parameters

-Force

Performs the action without a confirmation message.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Path<String>

Specifies a file path. The action saves the contents of a Trace Session to this file.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

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.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Session<IPpkTraceSessionEx>

Specifies an object that contains a Trace Session. To create a Trace Session, use the New-PefTraceSession cmdlet.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

false

-Trigger<Trigger[]>

Specifies an array of Trigger objects. When one of these triggers runs, the associated action saves the contents of the Trace Session.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Save the contents of a Trace Session with a stop trigger

This example creates a PEF Trace Session which you can save at any time by using the keyboard shortcut Ctrl+C. This example specifies the trigger explicitly, however, the use of Ctrl+C to stop the Trace Session is the default behavior.

The first command creates a Trace Session that runs in the Circular mode and stores a Trace Session object in the $TraceSession01 variable.

The second command uses the New-PefKeyDownTrigger cmdlet to create a trigger based on the keyboard shortcut Ctrl+C and stores it in the $Trigger01 variable.

The third command creates a save action for the Trace Session stored in the $TraceSession01 variable, which uses the trigger specified in the $Trigger01 variable. The command also specifies a name for the trace file to save. In addition, the command uses the Force parameter and therefore does not prompt you before replacing an existing file.


PS C:\> $TraceSession01 = New-PefTraceSession -Mode Circular -SaveOnStop
PS C:\> $Trigger01 = New-PefKeyDownTrigger -CTRLC
PS C:\> Save-PefDataCollection -Session $TraceSession01 -Path ".\Trace01.matu" -Force -Trigger $Trigger01
PS C:\> Start-PefCaptureSession -Session $TraceSession01

Related topics

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft