Delete events from the PowerShell event queue in the current session.

      Remove-Event [-EventIdentifier] int
         [-Confirm] [-WhatIf] [CommonParameters]

      Remove-Event [[-SourceIdentifier] string]
        [-Confirm] [-WhatIf][CommonParameters]

   -EventIdentifier int
       Remove only the events with the specified event identifier.

   -SourceIdentifier string
       Remove only events with the specified source identifier.
       The default is all events in the event queue.
       Wildcards are not permitted.

       Prompt for confirmation before executing the command.

       Describes what would happen if you executed the command
       without actually executing the command.

       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer -OutVariable.

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


Delete events with a given source identifier :

PS C:\> remove-event -sourceIdentifier "ProcessStarted"

Delete all events from the event queue:

PS C:\> get-event | remove-event

“In the End, we will remember not the words of our enemies, but the silence of our friends” ~ Martin Luther King, Jr

Related PowerShell Commands:

New-Event - Create a new event
Get-Event - Get events in the event queue
Unregister-Event - Cancel an event subscription

Copyright © 1999-2019
Some rights reserved