Make a Powershell Windows PE ISO

Oh I’ve been waiting a long time for this. PowerShell within WinPE

I was really excited about this functionality mainly for deployments but with the new ADK Windows Assessment and Deployment Kit (ADK) for Windows® 8 Consumer Preview http://www.microsoft.com/download/en/details.aspx?id=28997 it is possible to create WinPE ISO files and UDF/USB drives with a fully functioning PowerShell V3 shell inside.

Follow these instructions to install PowerShell within PE

These instructions are for installing PowerShell only, it does not include any instructions for adding network drivers or additional PE configurations required for production environments

Download the adkadksetup.exe from here http://www.microsoft.com/download/en/details.aspx?id=28997

Install the ADK to a location of your choice

Once installed open the deployment and imaging tools as an administrator

Create the WinPE files by running the command copype amd64 c:winpe_amd64

or for x86

copype x86 c:winpe_x86

Create a directory like c:mount

Mount the PE boot.wim by running the command

dism /mount-wim /wimfile:C:winpe_x86mediasourcesboot.wim /index:1 /mountdir:C:mount

or for X64

dism /mount-wim /wimfile:C:winpe_amd64mediasourcesboot.wim /index:1 /mountdir:C:mount

once mounted add the required packages from the location you installed the .. Assessment and Deployment KitWindows Preinstallation Environmentx86WinPE_OCs

or for X64

Assessment and Deployment KitWindows Preinstallation Environmentx64WinPE_OCs

Please note..For my testing, I added every package apart from the WinPE-Setup.cab as this caused issues within PE.

You can add the packages by running the DISM command..

dism /image:c:mount /add-package /packagepath:"C:Program Files (x86)Windows Kits8.0Assessment and Deployment KitWindows Preinstallation Environmentx86WinPE_OCsWinPE-WMI.cab"

Once you have added the packages, drivers ect you must unmount the file and commit the changes with DISM

dism /unmount-wim /mountdir:c:mount /commit

The last step is to create the WINPE bootable image. By using the MakeWinPEMedia file you can create a udf or iso file from the contents of the c:winpe_x86 or x64 directory.

makewinpemedia /iso c:winpe_x86 c:winPE_x86.iso

or

makewinpemedia /iso c:winpe_x64 c:winPE_x64.iso

For this demonstration I created an ISO to test on Hyper-V

Powershell runs when typing the command Powershell into the command prompt.

Powershell is running on V3 within the host and get-command shows 366 cmdlets

image

Thanks

Paul

 

Advertisements