Build a fully customized Windows PE environment with a simple PowerShell workflow.
WinPE Builder 2.0 automates creating a WinPE image with essential optional components, drivers, scripts, updates, and an ISO or USB — ideal for deployment, recovery, and troubleshooting media.
Init project → Add drivers / scripts / updates / packages → Build ISO or USB
Version 2.0 — project-based workflow,
packages.pecontrol, Secure Boot options (PCA 2011 / PCA 2023).
Looking for the original version 1.1 batch-based tool? See the legacy branch.
- ⚡ Build a custom WinPE ISO (or USB) in minutes
- 📁 Project folders for drivers, scripts, updates, and logs
- 📦 Default optional components included (PowerShell, DISM, BitLocker tools, and more)
- 📝 Edit
packages.peto enable or disable components without editing the script - 🔌 Inject drivers with ease
- 🧰 Copy your own scripts and tools into the image
- 🖼️ Customize the WinPE background
- 🔐 Optional modern Secure Boot signing (
-PCA2023) - 🚀 Perfect for deployment, recovery, and automation
These optional components are installed by default (dependency-safe order):
| Component | Purpose |
|---|---|
| WinPE-WMI | WMI / management foundation |
| WinPE-NetFx | .NET Framework subset |
| WinPE-Scripting | Windows Script Host |
| WinPE-PowerShell | PowerShell in WinPE |
| WinPE-DismCmdlets | DISM PowerShell module |
| WinPE-StorageWMI | Storage PowerShell cmdlets |
| WinPE-SecureBootCmdlets | Secure Boot PowerShell cmdlets |
| WinPE-HTA | HTML Applications |
| WinPE-FMAPI | File Management API |
| WinPE-SecureStartup | BitLocker / TPM tools |
| WinPE-EnhancedStorage | Enhanced storage / BitLocker-related devices |
On -Init, a project file packages.pe is created with these defaults enabled and other ADK optional components listed as comments — uncomment to add more.
📚 Learn more:
https://learn.microsoft.com/windows-hardware/manufacture/desktop/winpe-add-packages--optional-components-reference
Download and install the latest Windows Assessment and Deployment Kit (ADK).
https://learn.microsoft.com/windows-hardware/get-started/adk-install
The Windows PE add-on is separate from the main ADK. Install it before using WinPE Builder.
https://learn.microsoft.com/windows-hardware/get-started/adk-install#other-adk-downloads
Download the latest release ZIP and extract it, or clone the repository.
https://github.com/cmartinezone/WinPEBuilder/releases
Right-click Windows PowerShell → Run as administrator, then cd into the folder where you extracted the ZIP (the folder that contains WinPE-Builder.ps1).
cd C:\path\to\extracted\WinPEBuilderAfter extract (and after -Init), a typical layout looks like:
WinPEBuilder\ # folder from the ZIP (or your -WorkDirectory)
│
├── WinPE-Builder.ps1 # Main engine (run this)
├── packages.pe # Optional components list (created on -Init if missing)
│
├── Add-Drivers\ # Drivers injected into the image on -Build
├── Add-Scripts\ # Scripts, wallpaper, tools (see layout below)
├── Add-Updates\ # .msu / .cab updates
│
├── WinPE-Root\ # Working WinPE tree (managed by Init/Build)
├── WinPE-ISO\ # Generated ISO files
├── WinPE-Logs\ # Run logs
│
└── _docs\ # Simple guide, recipes, full reference
| Path | Goes to |
|---|---|
Add-Scripts\startnet.cmd |
Startup script (must keep wpeinit) |
Add-Scripts\winpe.jpg |
WinPE background |
Add-Scripts\System32\ |
Image Windows\System32 |
Add-Scripts\Root\ |
Image root (X:\) |
Add-Scripts\Media\ |
Boot media (WinPE-Root\media) |
Other files in Add-Scripts\ |
Copied into System32 (tools, scripts, etc.) |
Always pass -WorkDirectory (where the project lives). Two common choices after downloading the ZIP:
cd C:\path\to\extracted\WinPEBuilder
# Create project layout in the current folder
.\WinPE-Builder.ps1 -Init -WorkDirectory .
# Optional customization (see below):
# - Copy your drivers into Add-Drivers
# - Edit Add-Scripts\startnet.cmd and packages.pe
# Build ISO
.\WinPE-Builder.ps1 -Build -ISO -Force -AddPackage packages.pe💿 ISO output:
.\WinPE-ISO\WinPE_amd64_yyyyMMdd_HHmm.iso
cd C:\path\to\extracted\WinPEBuilder
# Create the project at a path you choose (folders + base WinPE + packages.pe)
.\WinPE-Builder.ps1 -Init -WorkDirectory C:\MyWinPE-Project
# Optional: copy your drivers into that project's Add-Drivers folder,
# edit Add-Scripts and packages.pe there, then build:
.\WinPE-Builder.ps1 -Build -ISO -Force -AddPackage packages.pe💿 ISO output (under your project folder):
<WorkDirectory>\WinPE-ISO\WinPE_amd64_yyyyMMdd_HHmm.iso
⚠️ Important: Always run as Administrator.
Builds usually complete in a few minutes (depends on packages and drivers).
All paths below are inside your project (-WorkDirectory — the ZIP folder if you used .).
Copy your wallpaper into the project as:
Add-Scripts\winpe.jpg
Recommended size: 800 × 600.
To use the default WinPE background again, remove that file.
Edit (or create) in the project:
Add-Scripts\startnet.cmd
Keep wpeinit at the top, then launch your tools or scripts:
@echo off
wpeinit
REM your commands hereCopy your driver packages (folders with .inf files) into:
Add-Drivers
They are injected automatically on -Build.
Copy your scripts, executables, or tools into:
Add-Scripts
Use subfolders when you need a specific destination:
| Put files in | Destination in the image / media |
|---|---|
Add-Scripts\ (root of that folder) |
Windows\System32 |
Add-Scripts\System32\ |
Windows\System32 |
Add-Scripts\Root\ |
Image root (X:\) |
Add-Scripts\Media\ |
Boot media (WinPE-Root\media) |
Created on -Init in the project folder.
# Default Components ← enabled (no #)
# Optional Components ← uncomment a line to enable
Open packages.pe in any text editor, adjust the list, then build:
.\WinPE-Builder.ps1 -Build -ISO -Force -AddPackage packages.peMissing packages are skipped with a warning; the build continues.
Copy your .msu / .cab update files into:
Add-Updates
Only with -Init. Point -BootWimPath at your WinPE boot.wim file:
.\WinPE-Builder.ps1 -Init -WorkDirectory . `
-BootWimPath ".\path\to\your\boot.wim"
⚠️ Warning:-USBformats the target drive. Double-check the letter (F:,E:, …).
Wrong drive = total data loss. The script refuses the system disk and non-USB buses, but you still choose the letter.
Recommended (safer for most people): build an ISO, then write it to USB with a tool such as Rufus.
# 1) Build ISO
.\WinPE-Builder.ps1 -Build -ISO -Force -AddPackage packages.pe
# 2) Open Rufus → select your USB stick → select the ISO under WinPE-ISO\ → StartOptional (ADK formats the stick directly):
.\WinPE-Builder.ps1 -Build -USB F: -Force -AddPackage packages.peOnly use -USB when you are sure of the drive letter and can wipe that stick.
Default media uses PCA 2011 (widest compatibility).
.\WinPE-Builder.ps1 -Build -ISO -PCA2023 -Force -AddPackage packages.peUse -PCA2023 only when target PCs trust the Windows UEFI CA 2023.
| Goal | Command |
|---|---|
| Init in current folder (ZIP extract) | .\WinPE-Builder.ps1 -Init -WorkDirectory . |
| Init at a custom path | .\WinPE-Builder.ps1 -Init -WorkDirectory C:\MyWinPE-Project |
| Resume project (new window) | .\WinPE-Builder.ps1 -WorkDirectory C:\MyWinPE-Project |
| Build ISO (recommended) | .\WinPE-Builder.ps1 -Build -ISO -Force -AddPackage packages.pe |
| Write USB via Rufus | Build ISO, then use Rufus (safer) |
| Build USB (formats drive) | .\WinPE-Builder.ps1 -Build -USB F: -Force -AddPackage packages.pe |
| Mount image | .\WinPE-Builder.ps1 -Mount |
| Save mount | .\WinPE-Builder.ps1 -Save |
| Discard mount | .\WinPE-Builder.ps1 -Discard |
Same PowerShell window keeps the project path after -Init or -WorkDirectory.
| Guide | When to use it |
|---|---|
| Simple guide | Full first-project walkthrough |
| Common uses | Short recipes |
| Usage reference | Every switch and option |
- Windows 10 / 11 (or Windows Server)
- Windows ADK + Windows PE add-on
- PowerShell as Administrator
If the ADK or WinPE add-on is missing, the script stops with a clear message and install link.
If WinPE Builder saves you time, consider buying me a coffee ☕
PayPal donation
If you find WinPE Builder useful, please consider giving the repository a ⭐ on GitHub.
It helps others discover the project and motivates future improvements.
https://github.com/cmartinezone/WinPEBuilder
Legacy (v1.1): github.com/cmartinezone/WinPEBuilder/tree/legacy
- Run elevated.
- Prefer ISO + Rufus for bootable USB;
-USBformats the selected drive — verify the letter first. -InitrebuildsWinPE-Root— do not re-Init a project you want to keep; resume with-WorkDirectoryalone.- Stuck mount:
.\WinPE-Builder.ps1 -Discardor-Clean -Force.

