Pre-cache Driver Packages using Modern Driver Management

With the release of the Invoke-CMApplyDriverPackage.ps1 script version 2.2.1 in our Modern Driver Management solution, we now support pre-caching (or pre-staging) driver packages matching the hardware vendor, model och operating system that it is targeted for an upgrade. Pre-caching driver package content on a device is only supported for the OSUpgrade deployment type using Modern Driver Management.


When pre-caching task sequence contents and if using the built-in Task Sequence content pre-caching feature (currently in pre-release state) in ConfigMgr, driver packages will not be pre-cached since the approach using Modern Driver Management is to dynamically detect and apply drivers at execution time. To support pre-caching of drivers packages when the Modern Driver Management solution is used to upgrade operating systems, content can now be downloaded to the local CCMCache.

With this new pre-caching feature of Modern Driver Management, you’ll have to use an approach where you use a separate task sequence that you configure to only pre-cache the content required and have it silently deployed to your clients. Below is an example of such a task sequence where the required content will be downloaded:

  • Operating System Upgrade package
  • Custom packages, scripts and tools
  • Driver Packages

What’s important in the above example is that there’s a condition for the Upgrade Operating System group that will never be met, e.g. where a non-existing variable equals true.

How to pre-cache driver packages

Ensure that you’are using version 2.2.1 or above of the Invoke-CMApplyDriverPackage.ps1 script from Modern Driver Management. A new value for the DeploymentType parameter called PreCache is now an option that can be used. When the DeploymentType parameter with this value is specified, the script will only perform it’s detection logic of what driver package content should be downloaded and not attempt to inject to update any drivers. Driver package content will be downloaded to the local CCMCache folder, so keep in mind to not run any custom script in your task sequence when it’s time to upgrade the operating system that cleans the local CCMCache folder, as the prestaged content will be removed.

In your pre-caching task sequence, recommended as the last action, add a new Run PowerShell script step with the following configuration:

  • Script name: Invoke-CMApplyDriverPackage.ps1
  • Parameters: -URI “” -SecretKey “<yourkeyhere>” -Filter “Driver” -DeploymentType “PreCache”
  • PowerShell execution policy: Bypass

It’s important that you specify the DeploymentType parameter value as PreCache, as it will instruct the script that it’s running in pre-caching mode and it will not attempt to install any drivers, only download the content from the detected driver package.

Executing a pre-caching task sequence

When the PreCache deployment type mode is being executed, the ApplyDriverPackage.log will contain the following entries when it has successfully detected a matching driver package and pre-cached the content:

Executing an upgrade operating system task sequence

When the pre-cached contents are already in the local CCMCache, there’s no requirement of using the Invoke-CMApplyDriverPackage.ps1 script any different from a regular upgrade operating system scenario. When a matching driver package has been detected, OSDDownloadContent.exe notices that the driver package content is already present in the local CCMCache and skip downloading it again.

Configure the Run PowerShell script step as below:

  • Script name: Invoke-CMApplyDriverPackage.ps1
  • Parameters: -URI “” -SecretKey “<yourkeyhere>” -Filter “Driver” -DeploymentType “OSUpgrade”
  • PowerShell execution policy: Bypass

Nickolaj Andersen

Chief Technical Architect and Enterprise Mobility MVP since 2016. Nickolaj has been in the IT industry for the past 10 years specializing in Enterprise Mobility and Security, Windows devices and deployments including automation. Awarded as PowerShell Hero in 2015 by the community for his script and tools contributions. Creator of ConfigMgr Prerequisites Tool, ConfigMgr OSD FrontEnd, ConfigMgr WebService to name a few. Frequent speaker at conferences such as Microsoft Ignite, NIC Conference and IT/Dev Connections including nordic user groups.


  • Thank you for this additional functionality.

    There are now drivers specific for each version of W10 and so there could multiple driver packages for each model.
    Is the script able to download the correct driver package for the W10 version used for the upgrade?


    • Oh i think i got excited to soon. I was hoping for a way to Pre-Cache the content and then be able to install them offline. But it sounds like this way the script will still try to contact the SCCM Server instead of just directly using the cached source.


Categories use cookies to ensure that we give you the best experience on our website.