# Generate Driver Pack Content Items

This process was created for DeployR 1.0, before the functions Get-DeployROemDriverPacks & Import-DeployROemDriverPacks were relased in 1.1.  This information is still helpful when creating custom driver packs for models the 2Pint catalog doesn't support.&#x20;

\
Using PowerShell can be a nice way to automate the generate of driver pack content items and save a bit of time vs using the dashboard.  There are a few steps in creating content items with PowerShell, first making the "Shell" Content Item, then the version item inside of it.  Just a note, this is different than importing one you exported from another DeployR server, this is creating a completely new content item from scratch in an automated fashion.&#x20;

You'll be leveraging a few different DeployR Function

* New-DeployRContentItem
* New-DeployRContentItemVersion
* Update-DeployRContentItemContent (If updating previously created Item Version)

For this Example, I have a Dell Pro 14 Plus PB14250 device, I've downloaded and extracted the drivers to "D:\DeployRSources\DriverPacks\Dell\Pro 14 Plus PB14250"\
\
First we'll create the Content Item Shell, once completed, we'll see this in the Dashboard.

{% hint style="info" %}
Note, anytime we're using the DeployR functions and interacting with DeployR, you'll need to import and connect to DeployR, you can find this on the Scripting for [DeployR Server page](https://documentation.2pintsoftware.com/deployr/powershell-modules/scripting-for-deployr-server)
{% endhint %}

```powershell
$MakeAlias = 'Dell'
$ModelAlias = 'Pro 14 Plus PB14250'
$NewCI = New-DeployRContentItem -Name "Driver Pack - $MakeAlias - $ModelAlias" -Type Folder -Purpose DriverPack -Description "Generated for $MakeAlias - $ModelAlias"
```

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2Fm7bm8gTFNaq26Ip8KicM%2Fimage.png?alt=media&#x26;token=9c568ab8-5925-40ba-baf4-e89311796156" alt=""><figcaption></figcaption></figure>

Now that the shell is created, go ahead and create the version item.  Grab the Content ID of the new item that was just created, and feed that into the New-DeployRContentItemVersion function.

<pre class="language-powershell"><code class="lang-powershell"><strong>$ContentId = $NewCI.id
</strong><strong>$InputSourceFolder =  "D:\DeployRSources\DriverPacks\Dell\Pro 14 Plus PB14250"
</strong>$NewVersion = New-DeployRContentItemVersion -ContentItemId $ContentId -Description "Source: $InputSourceFolder" -DriverManufacturer $MakeAlias -DriverModel $ModelAlias -SourceFolder "$InputSourceFolder"
</code></pre>

This will take a while as it builds the content item in DeployR, but when it's done, you can refresh your dashboard and see

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FFgUIBe7BmVEWaE21KlDg%2Fimage.png?alt=media&#x26;token=23d35957-a03e-49e2-9b6e-1163e12eaf2c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://744643921-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJO9NLelA0RS8JB4i9oaQ%2Fuploads%2FUmh8kVx3bPY8aw20xdLV%2Fimage.png?alt=media&#x26;token=e3d219c9-c1fd-4ba2-9fe3-d2ce09ce4b5a" alt=""><figcaption></figcaption></figure>

You can get a custom function on GitHub: <https://github.com/2pintsoftware/2Pint-DeployR/blob/main/Automation/Import-DriverPackFolder.ps1> to help with importing already extracted drivers.
