'Powershell: How to pause an event registered via "Register-ObjectEvent "
I am working to manage a recursion issue. My essential need is that when my event fires, I need to disable the event while my code runs, and then re enable the event at the end.
Because of code layout, I am looking for something like (pseudocode):
register-objectevent -name <event name> -pause=y
and
register-objectevent -name <event name> -pause=n
Does such a thing exist?
And if not, what are the alternatives to unregister/re-register?
And... is it even possible, in the action of an event, to unregister the event? (seems kind of circular and wrong?)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
