Delete events from the PowerShell event queue in the current session.
Syntax Remove-Event [-EventIdentifier] int [-Confirm] [-WhatIf] [CommonParameters] Remove-Event [[-SourceIdentifier] string] [-Confirm] [-WhatIf][CommonParameters] Key: -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. -Confirm Prompt for confirmation before executing the command. -WhatIf Describes what would happen if you executed the command without actually executing the command.
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
Remove an event monitor windevclusterEventMonitor previously setup with Register-CimIndicationEvent:
PS C:\> Get-EventSubscriber -SourceIdentifier windevclusterEventMonitor | Unregister-Event
To also clear out the queue itself:
PS C:\> Get-Event -SourceIdentifier windevclusterEventMonitor | Remove-Event
“In the End, we will remember not the words of our enemies, but the silence of our friends” ~ Martin Luther King, Jr
New-Event - Create a new event.
Get-Event - Get events in the event queue.
Unregister-Event - Cancel an event subscription.
Register-CimIndicationEvent - Subscribe to indications using a filter or query expression.