modifications for proper transaction support

I've modified and annotated the code so that the cmdlet supports transactions.  Take a look and let me know if you have any questions.