Add to Technorati Favorites
Welcome to ThePowerShellGuy.com Sign in | Join | Help

PowerShell eventing library 1.0 Released

Oisin, did release version 1.0 of his very cool PowerShell eventing library (See also my former entry about this : PowerShell Eventing Library : PSEventing 0.5 Beta released )

 

Some more information from the source :

For what it's worth, I've released PSEventing 1.0. I managed to nail
down the last few niggling things and for those of you who know what
the hell it's all about, (hi mow!) I urge you to try it out:

------- begin press release -------

PSEventing 1.0 Released
Trap and respond to synchronous & asynchronous .NET events within your
powershell scripts with this easy to use suite of cmdlets.

== What's new? ==

* A PSEvent object's Source property now contains the PSVariable
(instead of the string name of the variable)  wrapping the original
object which generated the event. This resolves scoping issues with
0.5 whereby it wasn't always possible to reach the original sender by
variable name (using get-variable).

* New-Event cmdlet added for inserting user-generated "events" into
the queue. This cmdlet allows attaching an abitrary object payload
which is available in the PSEvent's Args.Data property. Could be used
for inter-runspace comms if you're feeling crazy.

* All event handlers are now AUTOMATICALLY unhooked if the original
PSVariable goes out of scope! No more phantom events continually
generated if you forget to use the explicit "Disconnect-EventListener"
and lose your reference. Simply null out a variable or let it
disappear into the scopeless void!

* and finally, some bugfixes, as listed on the release page.

----------- end press release --------

I'm particularly proud of the self-unhooking event handlers -- no more
GC roots keeping objects alive (and the queue full of events you're no
longer interested in) if you let a variable go out of scope without
disconnecting the event handler.

I'll be writing a technical article on the hurdles I had over on
www.powershelllive.com in the coming few days, and I've also uploaded
full source for the 1.0 release for those of you interested in how
it's all done.

Have fun!

- Oisin Grehan / x0n.
If you did not try it out yet be sure to take a look at it it's great / 
Enjoy,
Greetings /\/\o\/\/

		
Published Monday, July 16, 2007 3:38 AM by MoW

Comments

No Comments
Anonymous comments are disabled