# PowerShell Script to PPKG

In this example, the PowerShell script Set-OemModel.ps1 will be converted to a Provisioning Package. This script is part of OSConfig and found in the OSConfig\Scripts directory. This script has a simple purpose of setting the OEM Model information in System Properties.

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_iliKdB2f1uJcXXsD%2F2018-09-02_23-55-52.png?alt=media\&token=ecac3f26-9c7e-4b15-9eaa-7319b049806c)

## Windows Imaging and Configuration Designer <a href="#windows-imaging-and-configuration-designer" id="windows-imaging-and-configuration-designer"></a>

If you don't have WICD installed, you can get it from the Windows 10 ADK. Create a new Project

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_jCJJhBsj6EjMpC6a%2F2018-09-04_12-58-43.png?alt=media\&token=209ee04f-90b4-4e55-8ac1-720697b0b2e3)

## Switch to Advanced Editor <a href="#switch-to-advanced-editor" id="switch-to-advanced-editor"></a>

Switch from the Basic to the Advanced Editor

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_jU-CvnhOcjlzogri%2F2018-09-04_12-59-34.png?alt=media\&token=8dc69a34-951f-4812-b898-55905f2361ca)

## Remove Runtime Settings <a href="#remove-runtime-settings" id="remove-runtime-settings"></a>

Select Runtime settings from the right Navigation Pane and select Remove

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_k2xpxXmCFhxAWV_M%2F2018-09-04_13-01-41.png?alt=media\&token=10107926-b6ad-4f36-8076-1a5005b608ef)

## Create a ProvisioningCommand <a href="#create-a-provisioningcommand" id="create-a-provisioningcommand"></a>

In the left Navigation Pane, expand ProvisioningCommands and PrimaryContext. Add a Name and press the Add button

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_kzg8AiNUzT7hKw_1%2F2018-09-04_13-05-18.png?alt=media\&token=c22e40d4-426f-4ba4-a07c-d17be34e7fa7)

## Set the Command <a href="#set-the-command" id="set-the-command"></a>

Select the Command on the Left Navigation Pane. In the Main window, Browse for the PowerShell file and enter the following CommandLine

```
PowerShell.exe -ExecutionPolicy Bypass -File Set-OemModel.ps1
```

Set the other values

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_mfhMrDXFEkYQY_G2%2F2018-09-04_13-13-17.png?alt=media\&token=d22dce08-32c8-4551-b910-084b6b11782e)

## Export the Provisioning Package <a href="#export-the-provisioning-package" id="export-the-provisioning-package"></a>

Select Export from the top Menu and then select Provisioning package

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_nCQvCpQPrRXINS8B%2F2018-09-04_13-16-02.png?alt=media\&token=3cc94aa9-5a44-40ff-84b2-508237c0853c)

## Build Owner <a href="#build-owner" id="build-owner"></a>

Change the Build Owner to IT Admin

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_nSMXNDydHD3b6IHN%2F2018-09-04_13-16-57.png?alt=media\&token=7a0db67b-5c89-481e-bd2c-3c875be70900)

## Build Security <a href="#build-security" id="build-security"></a>

Leave this blank for general Provisioning

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_ngRG3xiRmfZQMAVC%2F2018-09-04_13-17-55.png?alt=media\&token=a8d2b017-b68f-4589-9bb2-4dffceee02cd)

## Save Path <a href="#save-path" id="save-path"></a>

Set the proper location to save the Provisioning Package

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_oJw6vABFEL3WR8MR%2F2018-09-04_13-20-52.png?alt=media\&token=a2bbaeda-9fb8-47ee-be70-cba4d3d8778d)

## Build <a href="#build" id="build"></a>

Build the Provisioning Package

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_oT9YOsYzucXJdin2%2F2018-09-04_13-21-30.png?alt=media\&token=5058e56d-7039-4b47-9dcb-c894b3c85736)

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_oYTvxfO4Tzrq2DW1%2F2018-09-04_13-22-10.png?alt=media\&token=91ca5869-c74c-4dfb-b6fc-1e8f4a8047b2)

## Testing <a href="#testing" id="testing"></a>

You can easily test a Provisioning Package by simply double clicking on the file. You will be prompted for confirmation

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_or4RIIX_qaA1SHrg%2F2018-09-04_13-23-09.png?alt=media\&token=559a893d-44b9-4ff0-b4a7-ba075cedc749)

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_hfn01nEHFwm-_y4g%2F-LL_p7sI1Y_e-kTCklpL%2F2018-09-04_13-24-13.png?alt=media\&token=791a5ac6-547e-44ae-bd56-ab6b320ec11b)

## Validation <a href="#validation" id="validation"></a>

Here is a before and after to show the results

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_rCpxohq9rY3wAhfF%2F-LL_rIejahPnEIr3inHP%2F2018-09-04_13-32-32.png?alt=media\&token=570f6773-eeee-45d0-b2ff-0ec3c3405ed5)

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_rCpxohq9rY3wAhfF%2F-LL_rKc1aNjGtyFTUl5b%2F2018-09-04_13-32-55.png?alt=media\&token=c3a22b2e-f4b2-479e-9808-336a59fcd28f)

## Download <a href="#download" id="download"></a>

You can download the Provisioning Package created in this page by selecting the link below

## Further Information <a href="#further-information" id="further-information"></a>

Provisioning Packages are expanded to the Current User %Temp% directory

![](https://blobscdn.gitbook.com/v0/b/gitbook-28427.appspot.com/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LL_smmckOUyo6m2f0fa%2F-LL_sy55A4dQs445Rmc_%2F2018-09-04_13-27-55.png?alt=media\&token=935d896c-bba1-4dc7-87af-b55c7bbe2abd)

In the case of Provisioning Packages that are executed in OOBE, they are in the following location

```
%SystemRoot%\System32\Config\SystemProfile\AppData\Local\Temp\ProvisioningPkgTmp\*
```

​


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://osconfig.osdeploy.com/docs/untitled-3/powershell-script-to-ppkg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
