Lately, during the development > staging > production development cycle I have frequently come across the need to retract solutions in bulk.  So, I’ve put together a powershell script and .bat file combination that I can easily leverage to retract and remove a group of solutions.  No this isn’t the end all solution and I’m sure there are other more robust and/or elegant scripts, however, sometimes simple and to the point is the best place to start when getting you feet wet with this sort of challenge.

**In cases where the retraction fails to complete on its own, you will see repeated entries like this:
image

When this happens, leave the script running, navigate to the farm solutions list in Central Admin and manually retract the solution.  The script will pickup that the retraction is complete and will continue with the remainder of its work.

The zip file contains both the ps1 script and the calling bat file that you can use to automate the removal of all of the solutions relating to your current project.  While not quite as clean as reverting to a previous snapshot, this does cut down on the time to test your deployment script at least a few times per snapshot.