# Create a Windows Setup Answer File # Docs: https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/wsim/answer-files-overview # Docs: https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/components-b-unattend # Docs: https://learn.microsoft.com/en-us/windows-hardware/customize/desktop/unattend/ $wimMountDir = W: $wimFile = "" Dism /Get-ImageInfo /ImageFile:$WimFile | = $wimIndex # Mount a WIM image Dism /Mount-image /imagefile:$wimFile /index:$wimIndex /MountDir:$wimMountDir # TODO: Load answer file for fist-run configuration Dism /Image:C:\test\offline /Get-Features # Optimize image Dism /Image:C:\test\offline /cleanup-image /StartComponentCleanup /ResetBase Dism /Unmount-Image /MountDir:$wimMountDir /Commit