My experiences in Systems Management and IT Operations Management

Building Configuration Manager Driver Packages for Windows 7 with PowerShell and Double Driver

Edit 05/23/2016: I have added this script to Github and can be downloaded here.

I just recently posted an article and a PowerShell script that extracts drivers and creates driver packages using Configuration Manager Current Branch here. One of the things that I particularly liked about that script is that it was written using nothing but native PowerShell cmdlets. Windows 8.1 introduced to us the Export-WindowsDriver cmdlet. This cmdlet exports all 3rd-party drivers to a defined location. This cmdlet is not available for use in Windows 7, so the script was only written to work on Windows 8.1, and Windows 10. (The Export-WindowsDriver cmdlet is supported in Server 2012 R2, but I have not tested these scripts on the Server OS.) I originally had no intentions of building a script to work on Windows 7, but there was an large enough demand for it that I went ahead and put something together.

This leads us to HOW I got this to work. To work with Windows 7, we needed a 3rd party utility to do the “heavy lifting” of exporting the drivers from our installed Operating System. There are a few different utilities out there that do “driver scraping”, but I chose Double Driver for this. Partially because it has been around for a little while now with no issues; but more importantly because of the command line functionality. Double Driver offers the same functionality that the Export-WindowsDriver cmdlet gives us.

(You can download Double Driver from many locations on the internet. I take no responsibility for the use of freeware in any environment. I downloaded it from CNet personally.)

I essentially changed 1 line in the script to use Double Driver. The examples below will show the old and new entries:

I added the line to run “ddc.exe”, which is the Double Driver command line utility. I am running this using “.\” indicating it is looking for the “ddc.exe” utility in its current running directory. I do this because I am running these scripts Configuration Manager task sequences. Granted there is nothing stopping anyone from running them manually, that is how they were initially tested, I want them to run from CfgMgr. So I built a Package that contains the PowerShell script, only this time I include the Double Driver utility in the package source location.

I create the CfgMGr package with no Program. Then I create a Task Sequence to run the PowerShell script. (I describe why I use this method in the previous article found here.)

So with 1 line change, and the addition of a small utility, I can now automate a driver export from a client, import into CfgMGr, and build a driver package with one PowerShell script.

Below is a screenshot of the Task Sequence I use. It has both the Windows 8.1/10 and Windows 7 script and use the “Operating System Version” check in the Task Sequence Options.

I am trying to run this powershell script and I believe it isn’t liking that we have hyphens “-” in our server names. I am not much of a powershell person, but I wanted to ask if this script will run with hyphens in server names just to verify whether or not I am wrong.