> 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/powershell-modules/osdeploy/invoke-osdeploymdt.md).

# Invoke-OSDeployMDT

MDT LiteTouchPE exit script — runs automatically on every Update Deployment Share.

| Property | Value                                                                     |
| -------- | ------------------------------------------------------------------------- |
| Module   | OSDeploy                                                                  |
| Platform | Windows (MDT deployment share host)                                       |
| Requires | MDT installed, `Install-OSDeployMDT` previously run, Run as Administrator |

## Description

Called automatically by MDT as a LiteTouchPE exit script at each stage of the **Update Deployment Share** operation. The function reads the `$Env:STAGE` environment variable to determine which actions to take.

If `$Env:STAGE` is not set (for example, when the function is run manually), it displays help and returns without making changes.

**STAGE = WIM** (mounted WinPE image available):

* Collects EFI boot files and ADK `oscdimg` binaries to `DEPLOYROOT\Boot\bootbins\`
* Copies ADK OA3Tool to WinPE `System32`
* Applies DISM locale and time-zone settings
* Adds PackageManagement and PowerShellGet modules to WinPE
* Adds AzCopy, curl, and 7-Zip (`7zr.exe`) to WinPE `System32`
* Saves the OSDCloud PowerShell module into the WinPE image
* Injects WinPE drivers via an interactive picker

**STAGE = POSTISO**:

* Builds a patched ISO with `bootmgfw_EX.efi` for UEFI CA 2023 Secure Boot compatibility

MDT environment variables consumed: `STAGE`, `CONTENT`, `ARCHITECTURE`, `INSTALLDIR`, `DEPLOYROOT`.

## Syntax

```powershell
Invoke-OSDeployMDT [-SetInputLocale <String>] [-SetTimeZone <String>]
```

## Parameters

| Parameter         | Type     | Required | Description                                                                                     |
| ----------------- | -------- | -------- | ----------------------------------------------------------------------------------------------- |
| `-SetInputLocale` | `String` | No       | Sets the default input locale in WinPE. Default: `en-us`.                                       |
| `-SetTimeZone`    | `String` | No       | Sets the WinPE time zone. Validated against `tzutil /l`. Default: the current system time zone. |

## Examples

```powershell
# Run exit customization using current system locale and time zone
Invoke-OSDeployMDT
```

```powershell
# Run with a specific time zone
Invoke-OSDeployMDT -SetTimeZone 'Romance Standard Time'
```


---

# 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 dynamically by asking a question.

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

```
GET https://www.osdeploy.com/powershell-modules/osdeploy/invoke-osdeploymdt.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.
