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:
- Run
copype amd64 E:\PSWinDeploy\WinPE\Workspace. - Mount
boot.wimvia DISM. - Inject the PowerShell modules,
Start-Deploy.ps1, andstartnet.cmd. - Add required optional components (PowerShell, .NET, WMI, Storage packages, etc.).
- Unmount and commit the image.
- 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.