Skip to content

Latest commit

 

History

History
86 lines (63 loc) · 2 KB

Stop-PSEtwTrace.md

File metadata and controls

86 lines (63 loc) · 2 KB
external help file Module Name online version schema
PSEtw.dll-Help.xml
PSEtw
2.0.0

Stop-PSEtwTrace

SYNOPSIS

Stops an active PSEtw trace session.

SYNTAX

Stop-PSEtwTrace [-InputObject] <EtwEventArgs> [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Stops a PSEtw trace session started by Trace-PSEtwEvent. The trace session associated with the event provided to this cmdlet is the one that will be stopped.

EXAMPLES

Example 1 - Stop a trace after receiving an event

PS C:\> Trace-PSEtwEvent -Provider MyProvider | ForEach-Object {
    $_

    if ($_.Header.Descriptor.Id -eq 10) {
        $_ | Stop-PSEtwTrace
    }
}

Will capture events for the provider MyProvider until an event with the Id of 10 is received. The trace is stopped by piping the event into Stop-PSEtwTrace.

PARAMETERS

-InputObject

The event object that was created by the trace session that should be stopped.

Type: EtwEventArgs
Parameter Sets: (All)
Aliases:

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-ProgressAction

New common parameter introduced in PowerShell 7.4.

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

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

INPUTS

PSEtw.Shared.EtwEventArgs

The trace event can be provided as pipeline input.

OUTPUTS

None

This cmdlet does not output anything.

NOTES

RELATED LINKS