Borrowed from https://sccm-zone.com/deleting-the-sccm-cache-the-right-way-3c1de8dc4b48
Using the PowerShell code below will clear the ConfigMgr cache the correct way.
1 2 3 4 5 6 7 8 9 10 |
## Initialize the CCM resource manager com object [__comobject]$CCMComObject = New-Object -ComObject 'UIResource.UIResourceMgr' ## Get the CacheElementIDs to delete $CacheInfo = $CCMComObject.GetCacheInfo().GetCacheElements() ## Remove cache items ForEach ($CacheItem in $CacheInfo) { $null = $CCMComObject.GetCacheInfo().DeleteCacheElement([string]$($CacheItem.CacheElementID)) } |