Git Product home page Git Product logo

clear-ccmcache.ps1's Introduction

Clear-CCMCache PowerShell Script

Overview

The Clear-CCMCache PowerShell script is designed to remove old and unused content from the CCMCache folder used by the Microsoft System Center Configuration Manager (SCCM). This folder contains files that are downloaded by SCCM for various installations, including applications, patches, and task sequences.

The script uses Windows Management Instrumentation (WMI) to detect and remove items from the CCMCache folder that have not been referenced for a specified number of days.

Usage

To use the script, open a PowerShell prompt and navigate to the directory where the script file is located. Then, enter one of the following command line options:

.\Clear-CCMCache.ps1 [-Detect] [-Clean] [-Help] [-Days ##]
  • -Detect: Detects old and unused content in the CCMCache folder and reports the results.
  • -Clean: Cleans old and unused content from the CCMCache folder. If no option is provided, this is the default behavior.
  • -Help: Shows the help message with information about the available options.
  • -Days: Sets the number of days to keep files in the CCMCache folder. The default value is 30 days. This option can be used with both the -Detect and -Clean options.

For example, to clean content older than 14 days, run the following command:

.\Clear-CCMCache.ps1 -Clean -Days 14

Notes

  • The script requires administrative privileges to run.
  • The script should be executed on the client machine where SCCM is installed.
  • The default path for the CCMCache folder is C:\Windows\ccmcache.
  • The script uses WMI to query and delete items from the CCMCache folder. Therefore, it may take some time to complete, depending on the size of the folder.
  • The script is provided as-is and is not supported by Microsoft.

Contributing

If you find a bug or want to suggest an improvement, feel free to open an issue or submit a pull request on GitHub.

clear-ccmcache.ps1's People

Contributors

virtualox avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.