Skip to content

WinPE Build

The WinPE-Builder module wraps the ADK tools (copype, DISM) to produce a bootable WinPE image with the PSWinDeploy modules and scripts injected.

Automatic build

Import-Module .\Modules\WinPE-Builder\WinPE-Builder.psm1
Build-WinPE -Architecture amd64 -OutputPath 'E:\PSWinDeploy\WinPE'

This will:

  1. Run copype amd64 E:\PSWinDeploy\WinPE\Workspace.
  2. Mount boot.wim via DISM.
  3. Inject the PowerShell modules, Start-Deploy.ps1, and startnet.cmd.
  4. Add required optional components (PowerShell, .NET, WMI, Storage packages, etc.).
  5. Unmount and commit the image.
  6. Produce a bootable ISO with MakeWinPEMedia.

Manual module injection

If you need to update the scripts inside an already-built image without a full rebuild:

dism /Mount-Image /ImageFile:boot.wim /Index:1 /MountDir:C:\mount
:: copy updated files into C:\mount\Deploy\...
dism /Unmount-Image /MountDir:C:\mount /Commit

Useful DISM debug commands

:: List images in a WIM
dism /Get-WimInfo /WimFile:"E:\PSWinDeploy\WinPE\Workspace\media\sources\boot.wim"

:: Mount / unmount
dism /Mount-Image /ImageFile:boot.wim /Index:1 /MountDir:C:\mount
dism /Unmount-Image /MountDir:C:\mount /Commit

Creating a bootable USB key

MakeWinPEMedia /UFD E:\PSWinDeploy\WinPE\Workspace F:

Replace F: with the drive letter of the USB key (it will be formatted).

Architecture

Only amd64 and arm64 are supported since ADK 2004 (build 19041) removed x86. Passing -Architecture x86 raises an explicit error.