I ended up using that script. I was more hoping that I typed in something wrong to the cmdlet and that it still wasn't broken. That would have been an easier solution.
Friday was a great day for me. Right after getting frustrated with that I tried to write a script to set the content location of a deployment type with the cmdlets... Why can't Microsoft release well tested cmdlets? On Sun, Aug 17, 2014 at 4:03 PM, Joe Sestrich <j.sestr...@verizon.net> wrote: > That’s already been done? > > > > > http://blog.coretech.dk/kea/automate-importing-and-creating-drivers-packages-in-sccm-2012-r2/ > > > > *From:* listsad...@lists.myitforum.com [mailto: > listsad...@lists.myitforum.com] *On Behalf Of *Ryan > *Sent:* Friday, August 15, 2014 12:45 PM > *To:* mssms@lists.myitforum.com > *Subject:* [mssms] Import-CMDriver working? > > > > I wrote a script to import all drivers in a folder into CM 2012 and make > the folder name the category / driver package. I have the category and > driver stuff all working, but can't get the Import-CMDriver cmdlet to work. > First, I tried to specify a folder instead of an inf file to import but it > errored out. The documentation here: > http://technet.microsoft.com/en-us/library/dn151073(v=sc.20).aspx makes > it sound like I can do that when it says this: > > > -UncFileLocation<String> > > Specifies the network path (UNC) of the device drivers. > > To import all the device drivers that are contained in a specific folder, > specify the network path to the device driver folder. For example: > \\servername\folder. To import a specific driver from a folder, specify > the network path (UNC) to the Windows device driver .INF or mass storage > Txtsetup.oem file of the driver. > > > > Anyway, that's just an annoyance. So since it wasn't working I re-wrote > the import driver part to cycle through all inf files in the Driver folder > and individually import them. This kind of works. When I run the > Import-Driver command, it errors out with this error: > > Object reference not set to an instance of an object. > > However, the driver is created in ConfigMgr with the correct > AdministrativeCategory and all the correct settings but it is not in the > correct Driver Package. So, annoyed with this I decided to run the command > without the Driver Package information in it, save it to a variable, and > then run the Add-CMDriverToDriverPackage command specifying the Driver > Package object and the Driver object. It errors out still with no Driver > Package information and doesn't return an object, so I can't run > Add-CMDrivertodriverpackage... > > Any ideas? > > Here is the command I'm running: > > > > Import-CMDriver -UNCFileLocation $Driver.FullName -AdministrativeCategory > $Category -DriverPackage $DriverPackage -ImportDuplicateDriverOption > AppendCategory -EnableAndAllowInstall $True > -UpdateDistributionPointsforDriverPackage $True > > > >