# PowerShell Script PPKG

In this example, I'm going to detail how to wrap a PowerShell script in a Provisioning Package.  The best example I can use is the Provisioning Package that I created to expand Driver Packs in First Boot.

## PowerShell Script

First you need to make sure you have a standalone PowerShell Script that does not require interaction as Provisioning Packages won't allow that.  Here's my script that is saved in a PS1 file

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FPRmSnQXcnxbg7XIr7Ouw%2Fimage.png?alt=media&#x26;token=0e2a486f-1725-4195-b99c-5debe897145d" alt=""><figcaption></figcaption></figure>

## Windows Configuration Designer

Open Windows Configuration Designer and select Advanced Provisioning

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2Fl9fDJgI63Ct0V0fgulcd%2Fimage.png?alt=media&#x26;token=fcdd6c0a-f17f-42c4-a38e-bc80092f077b" alt=""><figcaption><p>Advanced provisioning</p></figcaption></figure>

Complete the details for your project and press Next

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FJkQJtewwbIBL3SsBOIBK%2Fimage.png?alt=media&#x26;token=e2ef6cd1-0ba8-4f78-897b-ab16a84750e4" alt=""><figcaption><p>(1) Enter project details (2) Press Next</p></figcaption></figure>

Select All Windows desktop editions and press Next

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FJtC2JeEUqbpmyfhjfl9N%2Fimage.png?alt=media&#x26;token=52ec4db6-3734-484d-ab06-dfd38b159380" alt=""><figcaption><p>(1) All Windows desktop editions (2) Press Next</p></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2F932a7OqCA3RbD7FSU5j6%2Fimage.png?alt=media&#x26;token=48bc20ce-43dd-4c66-86ee-d79c9cfc3b97" alt=""><figcaption><p>Press Finish</p></figcaption></figure>

## Runtime settings

Complete the following steps:

1. Expand Runtime settings
2. Expand ProvisoiningCommands, DeviceContext, CommandFiles
3. Press Browse
4. Find and select your PowerShell script
5. Press the Open button

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FbsqdA6dhoVTFyiJm6Rfc%2Fimage.png?alt=media&#x26;token=9ef5ea78-d8cc-4e6d-ae19-a22bb8f94189" alt=""><figcaption></figcaption></figure>

Press the Add button

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FJemF2LtzIy1gzEgrDZZR%2Fimage.png?alt=media&#x26;token=e8ca4fca-0462-4930-bffc-d4d3351f8895" alt=""><figcaption><p>Press the Add button</p></figcaption></figure>

Complete the following steps:

1. Select CommandLine
2. Enter the following command line (change the name of the PowerShell script to your file name)

```
PowerShell.exe -ExecutionPolicy Unrestricted .\Invoke-OSDCloudDriverPack.ps1
```

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FZEjDNaRSTGdfwRwNBqqd%2Fimage.png?alt=media&#x26;token=ddc308e9-0bd5-4c89-bcfc-e624ce498410" alt=""><figcaption></figcaption></figure>

Press Export and Provisioning package

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2Fl24emFbnnrtGhCbOXh57%2Fimage.png?alt=media&#x26;token=2ae52a56-e73a-4aa8-a730-f57f552329a8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2Fx54kYyZP6h81lb34c3mX%2Fimage.png?alt=media&#x26;token=67704373-744f-4304-8c1c-99b6187e9e33" alt=""><figcaption><p>(1) Describe the provisioning package (2) Press the Next button</p></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2F0AaIXgruco0BNSmW5rm0%2Fimage.png?alt=media&#x26;token=3fddb390-04da-40c0-8b21-b0ed22fe89a2" alt=""><figcaption><p>Press the Next button</p></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2F9SSZ8du78KU41Rz1yvkO%2Fimage.png?alt=media&#x26;token=1282bb2c-de9b-4117-a606-1759bdac0df7" alt=""><figcaption><p>Press the Next button</p></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FNcbVWsIihb4ST4FWZ9eZ%2Fimage.png?alt=media&#x26;token=6e515e04-14a2-4f37-8134-b3f5412b4bbc" alt=""><figcaption><p>Press the Build button</p></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FZY19F9JHXiiWMrT1XSzI%2Fimage.png?alt=media&#x26;token=bdec536e-4f04-454b-8541-5945e2f27a8c" alt=""><figcaption><p>(1) Click on the Project folder link (2) Press the Finish button</p></figcaption></figure>

<figure><img src="https://344220114-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MVSV22dcsjKDdOxDA6n%2Fuploads%2FPXEoBjTuThzvs3149sKD%2Fimage.png?alt=media&#x26;token=0617fc64-c4dc-46d3-a17c-8e27c3349732" alt=""><figcaption><p>Complete Provisioning Package</p></figcaption></figure>
