Jonathan Medd's Blog
Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
-
PowerShell 2.0: One Cmdlet at a Time #100 Remove-Event
Posted on May 13th, 2010 2 commentsContinuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Remove-Event cmdlet.
What can I do with it?
Delete an event from the current session. Note: to unsubscribe from an event you will need to use Unregister-Event.
Example:
Retrive current events in the queue with Get-Event, use Remove-Event to clear the event with the SourceIdentifier of Timer, then Get-Event again to confirm that it has been removed.
Get-Event Remove-Event -SourceIdentifier Timer Get-Event
You will see that the event has been cleared.
How could I have done this in PowerShell 1.0?
PowerShell engine events are a new feature in PowerShell 2.0.
2 responses to “PowerShell 2.0: One Cmdlet at a Time #100 Remove-Event”

-
Hello
where are your web page do you start with Powershell 2.0 tip #1? Good stuff man.
Leave a reply
-










Dan May 15th, 2010 at 20:28