$WMIPkgList = Get-WmiObject -Namespace Root\SCCMDP -Class SMS_PackagesInContLib | Select -ExpandProperty PackageID | Sort-Object $ContentLib = (Get-ItemProperty -path HKLM:SOFTWARE\Microsoft\SMS\DP -Name ContentLibraryPath) $PkgLibPath = ($ContentLib.ContentLibraryPath) + "\PkgLib" $PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Name | Sort-Object) $PkgLibList = ($PKgLibList | ForEach-Object {$_.replace(".INI","")}) $PksinWMIButNotContentLib = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "<=" } $PksinContentLibButNotWMI = Compare-Object -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassThru | Where-Object { $_.SideIndicator -eq "=>" } Write-Host Items in WMI but not the Content Library Write-Host ======================================== $PksinWMIButNotContentLib Write-Host Items in Content Library but not WMI Write-Host ==================================== $PksinContentLibButNotWMI