Reputation: 61378
In Powershell, one may hook an event on a .NET object by calling add_EventName
, like this:
$MyBlock = [System.EventHandler]{Write-Host Hello}
$MyObject.add_Completed($MyBlock)
How does one remove that event handler? Or reset the event to the state with no handlers?
This arised from here.
Upvotes: 1
Views: 302