Hi, I’m Haresh Hirani the mind behind Hiraniconfigmgr.com. I’m a seasoned IT professional with deep expertise in Microsoft technologies, especially in Configuration Manager (ConfigMgr/SCCM). Over the years, I’ve expanded my skill set to cover a broader range of modern device management platforms like Microsoft Intune, Jamf Pro, ManageEngine Endpoint Central, and VMware AirWatch (Workspace ONE UEM), I use this blog to document real-world, tested, working fixes and walkthroughs from my daily technical experiences. The 💡idea is simple: if it helped me, it might help someone like you. My goal is to create a living repository of practical IT solutions for the community. If you find something useful, or if you want to collaborate, feel free to connect with me on LinkedIn or drop a message through the Contact page.
Happy to help.
I receive an error when executing this :
$PksinContentLibButNotWMI
Get-ChildItem : Cannot find path ‘\\MYSERVER.domain.com\D$\SCCMContentLib\PkgLib’ because it does not exist.
At line:13 char:16
+ $PkgLibList = (Get-ChildItem $PkgLibPath | Select -ExpandProperty Nam …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (\\MYSERVER.d…ntentLib\PkgLib:String) [Get-ChildItem], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
Compare-Object : Cannot bind argument to parameter ‘DifferenceObject’ because it is null.
At line:17 char:91
+ … ct -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassTh …
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Compare-Object], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand
Compare-Object : Cannot bind argument to parameter ‘DifferenceObject’ because it is null.
At line:19 char:91
+ … ct -ReferenceObject $WMIPkgList -DifferenceObject $PKgLibList -PassTh …
+ ~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Compare-Object], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.CompareObjectCommand
Delete these items from WMI:
Delete .INI files of these packages from the PkgLib folder:
There’s a typo:
packageincontlib should be a plural: PackagesInContLib – packages not package.
There are also typos in the variable name but as they’re variables it’s not too important.
Using camelcase would make this easier to read.