This script repairs the "The package data in WMI is not consistent to PkgLib" and "Package can't be found in PkgLib" errors in smsdpmon.log on Distribution Points by
searching for packages that appear to be in de Content Library according to WMI but are not there and do not exist anymore.

This cleanup will run against all distribution points and when invalid WMI instances are found, they will be removed.
Detailed description of this issue:

NOTE: This script will only work on ConfigMgr 2012 R2. It does not support ConfigMgr 2012/SP1.

Script is to be used at own risk