-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] - Running Invoke-CCMCacheCleanup as SCCM package #20
Comments
Hi, If you run it as a detection script, you don't need a remediation script. You also need to suppress all output for this to work. |
I often use package to run PowerShell scripts that don't need to install anything, so I was trying to do that same thing here. Being that the script requires more than just the file name, and needs various parameters, how do you do that in a baseline? I can only select a script to run in a CI, but don't see a way to set the parameters (like for orphaned content). Further troubleshooting this, running it manually on my machine, with this command line: .\Invoke-CCMCacheCleanup.ps1 -CacheType "Orphaned" -CleanupType "Tombstoned" , I get this error: Script initialization failed. Cannot validate argument on parameter 'ScriptSection'. The argument is null or empty.
|
Yeah, I get it, but if there's no payload, why use packages? In a CI you just have to change the default parameters. I'll make a blog post in the future. Try the new version here I don't know if it fixes it entirely, but it will fix the error you get so we can see what else is wrong. The Please try to run the script manually with Thanks |
Sorry, I was going off the script comments that in the example appeared to include both of those conditions in the command. I've now tried this: Invoke-CCMCacheCleanup.ps1 -CleanupType "Tombstoned" , and it resulted in no errors, but didn't remove anything either. Are orphaned and tombstoned the same thing? Running just Invoke-CCMCacheCleanup.ps1 (which defaults to the All condition I think, right?), worked, deleting almost everything. Thank you for you assistance on this, it is much appreciated. |
So there is a parameter issue. Tombstoned means items that have passed the cache expiration date an can safely be deleted Orphaned means wmi items that have no links on disk or disk items that have no links in wmi I'll add a parameter check and explain these things better on the blog page. Thanks |
Looking for to the upcoming changes and implementing them in my environment. |
Describe the bug
Trying to run the Invoke-CCMCacheCleanup script as a package in SCCM and getting a failure (message ID error 10006).
To Reproduce
This is the command I'm using:
%SystemRoot%\SysNative\WindowsPowerShell\v1.0\PowerShell.exe -ExecutionPolicy Bypass -NoProfile -WindowStyle Hidden -File Invoke-CCMCacheCleanup.ps1 -CacheType "Orphaned" -CleanupType "Tombstoned"
Expected behavior
For the script to clean complete with no errors and ccmcache be rid of orphaned packages.
The text was updated successfully, but these errors were encountered: