Fix 0KB Driver Packages in System Cennter Configuration Manager 2012 with PowerShell
Applies to: Windows PowerShell 3.0+, SCCM
There is a known issue with System Center Configuration Manager 2012, where after importing or creating a driver package the size could be 0KB. The problem is, it causes a task sequence that is using the driver package to fail. Since the size is 0, it thinks that the driver package isn’t distributed to the distribution points. To resolve this you must perform the following actions in the console. Make sure the driver pack is distributed then remove one driver from the driver package and add it back in along with redistributing it. This may not seem like something worth scripting, but let me assure you it is. Once you have 40+ driver packages the console takes an extremely long time to load, around 10 minutes for me. Another reason is I import several packages at a time and updating them all one by one takes a lot of time.
Below is a script I’ve written along with a function for adding drivers to a driver package online. The script will search for any driver packages that have a size of 0KB and then remove the first driver listed in the driver package, add it back in and then update the driver package. Sometimes the first driver won’t update the size, so I change the 0 in line 32 to 1 and run the script again to remove and re-add driver 2. You’ll need to replace SiteCode and Server on lines 2 and 3 with information from your environment.