Jonathan Medd's Blog
Scripting. Powershell, VMware, Windows, Active Directory & Exchange. All that kind of stuff…..
-
PowerShell 2.0: One Cmdlet at a Time #99 Unregister-Event
Posted on May 11th, 2010 No commentsContinuing the series looking at new cmdlets available in PowerShell 2.0. This time we look at the Unregister-Event cmdlet.
What can I do with it?
Clear an event subscription.
Example:
Use Get-EventSubscriber to retrive details of current events. Clear the event with subscription id 1 and Get-EventSubscriber again to confirm that it has been removed.
Get-EventSubscriber Unregister-Event -SubscriptionId 1 Get-EventSubscriber
You will see that the event subscription has been cleared.
How could I have done this in PowerShell 1.0?
PowerShell engine events are a new feature in PowerShell 2.0.
Leave a reply










