I frequently need to apply a Win10 image from my organization to laptops that come with an OEM image. To do this I need to clean the primary drive with DiskPart. I'd like to create a bootable USB WinPE drive, use the firmware boot menu to boot WinPE and apply my changes to primary drive of the new laptop before pulling my Win10 image from the servers. The Windows Hardware Developer section of Docs has a beautiful section on doing all this.
I've been stuck for a few days however simply trying to get the USB drive formatted. There is a bit of humor to it since the reason I need the bootable WinPE is to resolve such a similar issue.
More or less the final step in creating this bootable WinPE is to run the MakeWinPEMedia operation in the Deployment and Imaging Tools Environment from the ADK. In my case, like this:
MakeWinPEMedia /UFD C:\WinPE_amd64 D:
where the working files reside on C: and the USB flash stick is D: (the "technician PC" is 64 bit, hence the "amd64")
The process always fails with "DiskPart errorlevel -2147024809". I've been trying many things: I've turned off Secure Boot in the UEFI firmware. (I've repeated that with an extra reboot) I've cleaned the USB itself with DiskPart and tried it. I've cleaned the USB and partitioned and formatted it in about every way possible including all the suggestions from about every search out there. The technician PC is a new enough model that handles bootable USB drives well but I've tried different USB ports on it nonetheless. The technician PC is at 2004 (trying to push it to 20H2 as another thing to try.) Some of the searches showed discussions prior to Win10 where the flash drive was built up manually and the contents copied to it - perhaps I should be pursuing that?
Thanks for reading and would appreciate your thoughts and suggestions.