다음을 통해 공유


Remove-Event

Deletes events from the event queue.

구문

BySource (기본값)

Remove-Event
    [-SourceIdentifier] <String>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ByIdentifier

Remove-Event
    [-EventIdentifier] <Int32>
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Remove-Event cmdlet deletes events from the event queue in the current session.

This cmdlet deletes only the events currently in the queue. To cancel event registrations or unsubscribe, use the Unregister-Event cmdlet.

예제

Example 1: Remove an event by source identifier

PS C:\> Remove-Event -SourceIdentifier "ProcessStarted"

This command deletes events with a source identifier of Process Started from the event queue.

Example 2: Remove an event by event identifier

PS C:\> Remove-Event -EventIdentifier 30

This command deletes the event with an event ID of 30 from the event queue.

Example 3: Remove all events

PS C:\> Get-Event | Remove-Event

This command deletes all events from the event queue.

매개 변수

-Confirm

Prompts you for confirmation before running the cmdlet.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:cf

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-EventIdentifier

Specifies the event identifier for which the cmdlet deletes. An EventIdentifier or SourceIdentifier parameter is required in every command.

매개 변수 속성

형식:Int32
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

ByIdentifier
Position:0
필수:True
파이프라인의 값:False
속성 이름별 파이프라인의 값:True
나머지 인수의 값:False

-SourceIdentifier

Specifies the source identifier for which this cmdlet deletes events from. Wildcards are not permitted. An EventIdentifier or SourceIdentifier parameter is required in every command.

매개 변수 속성

형식:String
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

BySource
Position:0
필수:True
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

매개 변수 속성

형식:SwitchParameter
Default value:False
와일드카드 지원:False
DontShow:False
별칭:wi

매개 변수 집합

(All)
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

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

입력

PSEventArgs

You can pipe events from Get-Event to this cmdlet.

출력

None

This cmdlet returns no output.

참고

Events, event subscriptions, and the event queue exist only in the current session. If you close the current session, the event queue is discarded and the event subscription is canceled.