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.
PowerShell is a complete replacement for any of Microsoft’s DOS or Windows command line interpreters. It is a full fledged object oriented system administration scripting language. With PowerShell knowledge you would run circles around any sysadmin that works predominantly from through the GUI, as well as be able to get Windows to do things that you just can’t do through a GUI alone.