MEM-Zone / MEM.Zone

Our ♡ collection of PowerShell scripts and Endpoint Management related stuff 🐵
https://MEM.Zone/GIT
GNU General Public License v3.0
97 stars 10 forks source link

Error On Line 831 - When No User Has Logged Onto Device #8

Closed SCCMWalker closed 1 year ago

SCCMWalker commented 3 years ago

Howdy Ioan,

I found an issue if you have no users that have logged onto the device yet, at least in my environment, you get an error when trying to populate the $Packages variable. The error is a generic failure when trying to access the namespace. I would suggest adding ErrorAction SilentlyContinue to that line as so. I will try to attach the full error if I can get to it. $Packages = Get-CimInstance -Namespace 'Root\ccm\ClientSDK' -ClassName 'CCM_Program' -Verbose:$false -ErrorAction SilenetlyContinue

Ioan-Popovici commented 1 year ago

Invoke-CCMCacheCleanup release history

6.0.0 - 2023-07-28