PowerShell script for removing multiple WSP solutions
In case of big SharePoint Farms with multiple SharePoint WSP solutions deployed, sometimes it is very difficult to remove some specific solutions automatically as each solution retraction takes some time and we may also need to execute SharePoint 2010 Administration service (SPAdminv4) Job after removing individual solution from the Farm. A more manageable way could be to create a PowerShell script, that runs on the Farm to remove the listed wsp solutions. I created one of such solution for a client who had around 50-60 such solutions. Below is the script that you can use to completely uninstall the wsp solutions from SharePoint Farm. This script should be placed inside a folder along with the wsp solutions which needs to be removed.
Copy-Paste the below script in a text file and rename its extension to - *.ps1
write-host"Setting up PowerShell environment for SharePoint..."-foregroundcolorYellow