I created a custom Windows answer file and want to use it with an existing bootable USB installation. My goal is to test the setup in a virtual machine without repeatedly configuring USB passthrough. Is there a PowerShell, DISM, or Microsoft deployment tool that can combine the USB contents and answer file into a bootable ISO, or is there a simpler approach?
3 Answers
For quick testing, an ISO-editing utility can inject the XML file into an existing image. Another option is to attach a small virtual floppy, USB disk, or FAT-formatted virtual drive containing the answer file. That avoids modifying the Windows ISO and makes it easy to swap in revised files.
If you specifically want to create a new bootable ISO, look at Microsoft's Oscdimg utility. It is included with the Windows Assessment and Deployment Kit rather than being built directly into Windows. It can create bootable ISO images from a folder containing the Windows installation files and your answer file.
You may not need to rebuild the Windows media at all. For a virtual machine, keep the original Windows ISO attached as the boot device and create a second, small ISO containing only your unattended answer file. Attach both ISO images to the VM. The Windows installer can read the answer file, and updating it is much faster than rebuilding the full installation image each time.

I hadn't come across Oscdimg before. I'll look into the ADK approach as well.