Dism Commands - nonoloki2/Devops GitHub Wiki
Create a Data Image Using DISM
To add applications, files, and other resources to Windows during an installation, you can create a data image. By using the Deployment Image Servicing and Management (DISM) tool, you can create additional Windows image (.wim) files that contain only files and applications that you intend to copy to the Windows installation.
Data images enable you to add:
Applications, files, scripts, and other resources to Windows during an installation.
Files, resources, and other data to a partition other than the operating system partition.
Note Data images must be used only to add new files to a Windows installation. Do not use data images to replace existing Windows files. Overwriting operating system data is unsupported.
Previous methods of transferring data to a Windows installation required the use of $OEM$ folders. These folder structures are still supported, but data images provide an easier and more efficient means of transferring additional data to Windows.
In unattended installations, the Windows image to install is specified by the OSImage setting in the Microsoft-Windows-Setup component. You can add one or more DataImage settings in the Microsoft-Windows-Setup component that represent additional data images that you add to the system.
Dism /Capture-Image /ImageFile:c:\data\myData.wim /CaptureDir:C:\data\dataFiles /Name:MyData
Injecting Drivers on Boot Images with Dism
Dism /Mount-Image /ImageFile:C:\test\images\install.wim /index:1 /MountDir:C:\test\offline
Use the following DISM command to add the driver(s):
Dism /Image:C:\test\offline /Add-Driver /Driver:c:\drivers /Recurse
Verify if the drivers was added
Dism /Image:C:\test\offline /Get-Drivers
Use the following DISM command to unmount the Boot.wim:
Dism /Unmount-Image /MountDir:C:\test\offline /Commit