[SPS] Run a Dispose Check on a SPS2010 and export results to CSV

OK, so we have (let’s say) 300+ custom solutions on our SPS2010 environment and want to create a SPDisposeCheck report against them. The report should then be presented in the form of a CSV file.

So here goes:

  1. First download SPDisposeCheck for SharePoint 2010 (note: it’s only for SPS2010, as it does not check .NET 4 assemblies) from here: https://gallery.technet.microsoft.com/office/SharePoint-Dispose-Checker-01da48e8
  2. Extract all the farm’s WSPs using the PowerShell script below:

3. As WSPs are basically CAB archives, we would need to extract the contents of the WSPs in order to get the DLLs contained within them:

4. Then have all those DLLs checked with SPDisposeCheck:

The above script will create multiple reports (one for each verified DLL).

5. Now to create the CSV report based on the multiple report files: