Hi, I Haresh Hirani, I am the person behind this webpage. Welcome to my page, Thank you for visiting the website and my page! My website is all about Microsoft technologies. More about ConfigMgr and all other technologies which are interesting for me. However, larger percentage of my posts are related to SCCM. Normally, like to post the interesting issues which I came across in my day to day tech life. you will find only solutions which comes on my day to day life.
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.