This morning I integrated our PowerShell processes into FogBugz by writing a small module that submits occurrences of all errors to BugzScout. You might want to do something similar so I did this write-up.
Broadly it works similar to BugzScoutLogWriter that I developed previously for integration with SilverStripe CMS. In this case however, we need to do the following things:
- Set the script to stop on all errors so they can be trapped instead of ending the execution of the script.
- Capture the error details and submit them to FogBugz
- Have an error occur. ;)
I've published the code in a Gist for you a have a look. I include the function in every script I use.