Solved PowerShell is not working in WinPE - Windows 11 23 H2


ijalabs

Active member
Local time
6:20 PM
Posts
22
OS
Windows 11
Hi Experts,

I am working on creating a WinPE Bootable USB for deploying image with PowerShell support for Windows 11 23H2. I am creating the script by following the below given steps.
  • Installed updated ADK ADK 10.1.26100.1
  • Installed updated Win PE addon 10.1.26100.1
  • Once installation is completed "Start the Deployment and Imaging Tools Environment as an administrator"
  • Created a folder copype amd64 C:\WinPE_amd64_PS
  • Followed the link to include the Add WinPE PowerShell optional components
  • then copied the contents to USB then booted to WinPE
  • while running the PowerShell command the command is completing fine but the output is not coming
  • PowerShell -command "&{Get-PhysicalDisk}" or get-disk the command is running fine but the output is not coming
1720052274392.png

1720052349211.png

1720052387328.png

I tried multiple commands like get-partition / get-volume / Get-Disk | Where-Object -FilterScript {$_.Bustype -Eq "USB"} - for all these commands the i am not getting output.
but if try the same commands in Win11 22H2 it is working fine without issue.

1720053809394.png
1720053835217.png


Kindly suggest how we can fix this issue in Windows 11 23H2. I have followed the same steps in Win 11 22H2 and it is working fine without issues.

Thanks
IjalaB
 
Windows Build/Version
Windows 11 23H2
Last edited:

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Z2 SFF G9
I presume you correctly added "Windows PowerShell/WinPE-StorageWMI".

Does diskpart find any drives when PS doesn't? If diskpart doesn't see anything, then your WinPE image is missing drivers.
 

My Computer

System One

  • OS
    Windows 7
Issue is fixed, while modifying the startnet.cmd we need to keep the wpeinit if this is not present PowerShell is not working.
 

My Computer

System One

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Z2 SFF G9

Latest Support Threads

Back
Top Bottom