Skip to main content
How can we help?

Welcome to our Support Portal. Search for answers using the search box below.,

Print

Add Powershell to WINPE –

Windows PE (WinPE) does not include PowerShell by default, but you can add it when creating your custom WinPE image using Deployment Image Servicing and Management (DISM).

Prerequisites for Your Technician PC

  • Install the Windows Assessment and Deployment Kit (Windows ADK).
  • Install the Windows PE add-on for the ADK.
  • Run the Deployment and Imaging Tools Environment as an Administrator.

Step-by-Step Guide to Adding PowerShell

At this point you will use the Administration: Deployment and Imaging Tools Environment prompt:

  1. Create working WinPE filescmdcopype amd64 C:\WinPE_amd64 Use code with caution.
  2. Mount the WinPE imagecmddism /Mount-Image /ImageFile:C:\WinPE_amd64\media\sources\boot.wim /Index:1 /MountDir:C:\WinPE_amd64\mount Use code with caution.
  3. Add the required packages (In Exact Order)
    You must add these specific optional components to support PowerShell: dism /Image:C:\WinPE_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-WMI.cab" dism /Image:C:\WinPE_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-NetFX.cab" dism /Image:C:\WinPE_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-Scripting.cab" dism /Image:C:\WinPE_amd64\mount /Add-Package /PackagePath:"C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Windows Preinstallation Environment\amd64\WinPE_OCs\WinPE-PowerShell.cab"
  4. Verify the packages are installedcmd dism /Image:C:\WinPE_amd64\mount /Get-Packages Use code with caution.
  5. Commit changes and unmount the imagecmd dism /Unmount-Image /MountDir:C:\WinPE_amd64\mount /Commit Use code with caution.
  6. Create bootable media (Example: USB drive)cmdMakeWinPEMedia /Ufd C:\WinPE_amd64 F: Use code with caution.(Replace F: with your actual USB drive letter)

How to Launch It in WinPE

When you boot into your new WinPE environment, the command prompt will open automatically. Type powershell and press Enter to start the PowerShell console.

Would you like help with adding language packs, including custom script files to run automatically at boot, or injecting specific hardware drivers into this image?