Removing [MissingFeature] Database & [MissingWebPart] WebPart class errors from SharePoint 2010

My customer performed an in-place upgrade of SharePoint 2007 to SharePoint 2010.  Unfortunately, several errors were left over and constantly flagged in the SharePoint Health Analyzer.  The errors were like the below: 

[MissingWebPart] WebPart class [fe5408f9-d9d4-a317-6c7f-122032c54475] is referenced [1] times in the database [APP], but is not installed on the current farm. Please install any feature/solution which contains this web part. One or more web parts are referenced in the database [APP], but are not installed on the current farm. Please install any feature or solution which contains these web parts.

[MissingWebPart] WebPart class [880815b9-32e7-d93b-2986-2bfc4bd5bd40] is referenced [2] times in the database [APP], but is not installed on the current farm. Please install any feature/solution which contains this web part. One or more web parts are referenced in the database [APP], but are not installed on the current farm. Please install any feature or solution which contains these web parts.

[MissingWebPart] WebPart class [d95bc79a-fe40-22a8-7519-a2af30527de7] is referenced [2] times in the database [APP], but is not installed on the current farm. Please install any feature/solution which contains this web part. One or more web parts are referenced in the database [APP], but are not installed on the current farm. Please install any feature or solution which contains these web parts.

[MissingFeature] Database [SharePoint_AdminContent_a67e0e61-fddd-4161-84de-a86fc5751899] has reference(s) to a missing feature: Id = [0b4aad40-406f-425c-bdd9-5894c42cffcb]. The feature with Id 0b4aad40-406f-425c-bdd9-5894c42cffcb is referenced in the database [SharePoint_AdminContent_a67e0e61-fddd-4161-84de-a86fc5751899], but is not installed on the current farm. The missing feature may cause upgrade to fail. Please install any solution which contains the feature and restart upgrade if necessary.

Typically, these types of errors can be cleaned up using the SharePoint Feature Administration and Clean Up Tool on CodePlex.  Unfortunately, in this case, the tool did not work and we were still searching for a way to remove these errors from the Health Analyzer.  Doug Arnold found this great BLOG Get-SPScripts by Phil Childs that lists tons of helpful PowerShell scripts to help you manage your SharePoint 2010 installation. 

I take no credit for this content whatsoever, but I want to help others find a way to remove these errors so I am reposting this.

To remove the [MissingFeature] Database error, check out this BLOG post.

To remove the [MissingWebPart] WebPart class errors, check out this BLOG post.