> For the complete documentation index, see [llms.txt](https://www.osdeploy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.osdeploy.com/archive/osdeploymdt/install-osdeploymdt.md).

# Install-OSDeployMDT

## Purpose

`Install-OSDeployMDT` initializes an existing MDT Deployment Share for OSDeploy. It is a one-time setup function that configures the share so that `Invoke-OSDeployMDT` runs automatically during **Update Deployment Share** and WinPE is customized with the required settings, tools, and drivers.

> Requires local **Administrator** rights.

***

## What It Does

### Audit mode

Without `-Force`, the function runs in audit mode and reports the current deployment share state without making changes.

### Initialization steps

With `-Force`, the function performs these actions:

1. Resolves the MDT installation directory (`INSTALLDIR`) and active deployment share (`DEPLOYROOT`).
2. Creates `Templates\`, `Templates\winpe-drivers\`, and `Templates\winpe-extrafiles\`.
3. Copies `winpeshl.ini`, `Wimscript.ini`, `Unattend_PE_x64.xml`, and `LiteTouchPE.xml` from `INSTALLDIR\Templates`.
4. Copies `Background.bmp` from `INSTALLDIR\Samples` to `DEPLOYROOT\Templates\background.bmp`.
5. Rewrites `%INSTALLDIR%` references in `LiteTouchPE.xml` so the templates under `DEPLOYROOT` are used.
6. Copies or writes the WinPE `<Components>` block from `Boot\LiteTouchPE_x64.xml`.
7. Registers `Invoke-OSDeployMDT` as the LiteTouchPE exit command.
8. Updates `Control\Settings.xml` to disable x86 boot image generation and set x64 scratch space to 512 MB.

### Result

After a successful run, the next **Update Deployment Share** operation uses the customized WinPE templates, invokes `Invoke-OSDeployMDT`, and exposes the `winpe-drivers` and `winpe-extrafiles` drop locations in the deployment share.

***

## Example

```powershell
Install-OSDeployMDT -Force
```

Run once after creating a new MDT Deployment Share, before the first **Update Deployment Share**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.osdeploy.com/archive/osdeploymdt/install-osdeploymdt.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
