During some testing that I had been working on, I ended up creating about 50 different management packs which contained some rules which I was testing how to translate from MOM 2005 to OpsMgr 2007. To clean up my lab environment I needed to delete these 50 management packs but I really didn’t want to spend the afternoon working on it. Some digging on the web ran across this discussion (Thank you Graham and Marco!) which hit exactly what I wanted to do via a powershell command. For my environment I had named all of these management packs with the word test, so this is the syntax I used to remove them from my lab environment:

Get-managementpack | where{$_.displayname –like “*Test*” | uninstall-managementpack

Do not use this in a production environment without fully testing this as this command done incorrectly could remove all management packs from the environment.