|
|
PSEventing 0.5 beta released
Events in PowerShell - but how? Events in a .NET executable are generally raised and handled in realtime; at first glance, this doesn't seem possible with our favourite little shell. PowerShell lets us wire up scriptblocks to .NET events as handlers quite easily, but unfortunately when the event is raised, there is no runspace available to execute our script. So, how do we get a runspace to execute a handler? Well, we ensure that we are in a running pipeline before processing events. This is achieved by disconnecting the process: we separate the occurance of events from the act of handling them.
- example script on homepage with system.io.filesystemwatcher - example script for async backup of sqlserver with write-progress with download
more example scripts will be available soon.
see MoW's post: http://thepowershellguy.com/blogs/posh/archive/2007/05/09/powershell-...
available at: http://www.codeplex.com/PSEventing (source will be available soon)
Have fun, and please leave feedback, issues, ideas, etc on codeplex you can! much appreciated.
- Oisin / x0n
|
|
|