Chuck Heatherly
2009-05-26 15:29:35 UTC
For PowerShell 1.0, it was advised to use Oisin Grehan's PSEventing
toolkit to capture Control-C events. The page for this toolkit,
http://www.codeplex.com/PSEventing, now says that it is intended for
use with PowerShell 1.0 only, that PowerShell 2.0 CTP2 has introduced
support for eventing.
Could someone provide a code sample for V2 CTP2 or CTP3 that shows how
to intercept Control-C? I want my script to be able to do some final
operations in the event that Control-C is pressed, like properly
finalize XML files (write the closing tags).
Thanks,
Chuck
toolkit to capture Control-C events. The page for this toolkit,
http://www.codeplex.com/PSEventing, now says that it is intended for
use with PowerShell 1.0 only, that PowerShell 2.0 CTP2 has introduced
support for eventing.
Could someone provide a code sample for V2 CTP2 or CTP3 that shows how
to intercept Control-C? I want my script to be able to do some final
operations in the event that Control-C is pressed, like properly
finalize XML files (write the closing tags).
Thanks,
Chuck