amidaware / community-scripts

A curated list of powershell, python, and batch scripts for use in TacticalRMM or anywhere!
MIT License
122 stars 84 forks source link

Remove cleanmgr and PromptForScan functions #189

Closed joeldeteves closed 9 months ago

joeldeteves commented 1 year ago

This PR removes the cleanmgr.exe and PromptForScan functions from the script.

Reasons:

  1. PromptForScan -> obviously this will never complete in an RMM environment like Tactical. Secondly, we shouldn't remove ISOs anyways without the user's permission (just a bad idea like a sysadmin accidentally running on a server and deleting all IT ISOs).

  2. cleanmgr.exe -> this is hit and miss at all times - on half the systems it runs on, it hangs due to a hidden window in the background. I've tested all variants and it's not reliable. Secondly, cleanmgr.exe is technically deprecated and is being slowly phased out by StorageSense. Third, everything else in the script does exactly what cleanmgr does - so the functionality is duplicated.

I've tested these changes repeatedly on different agents and it works correctly now.

On some systems, it frees up a couple of GB - that's consistent with cleanmgr so it does appears that without cleanmgr the script works as intended (including the SoftwareDistribution folder and temp files).