DISM
The Deployment Image Servicing and Management (DISM) platform is used to mount and service Windows images before deployment. A subset of DISM commands can be used on online Windows images. You can use DISM tools to mount, and get information about, Windows image (.wim) files or virtual hard disks (.vhd or .vhdx). You can also use it to install, uninstall, configure, and update Windows features, packages, and drivers in a Windows image or to change the edition of a Windows image.
This topic introduces the DISM cmdlets available in the DISM PowerShell module. This module is available in Windows 8.1 and Windows Server 2012 R2. On other supported operating systems, you can install the DISM module from the Windows Assessment and Deployment Kit (Windows ADK) . For more information about how to use the DISM PowerShell module installed with the ADK, see How to Use DISM in Windows PowerShell .
For Windows 8.1 and Windows Server 2012 R2, Windows PowerShell 4.0 is included in the installation. For other supported versions of Windows and Windows Server, (including Windows 8, Windows 7 SP1, Windows Server 2012, and Windows Server 2008 R2 SP1), you must install Windows Management Framework 4.0. You can download and install Windows Management Framework 4.0 from the Microsoft Download Center.
The DISM platform also includes a command-line tool, DISM.exe, and the DISM API . The command-line tool is available in the Windows Assessment and Deployment Kit (Windows ADK) and includes additional functionality that supports servicing commands for international settings.
You can check for errors when running DISM cmdlets by checking if the $?. If set to True the last operation succeeded. If False the last operation failed. The $LASTEXITCODE contains the exit code of the last Win32 executable run. For example, to check that the Get-WindowsImage cmdlet fails to get information about the Windows image contained in the file, E:\images\c.wim, type the following:
try
{
Get-WindowsImage -ImagePath E:\images\c.wim
}
catch
{
$message = "TRAPPED: {0}: '{1}'" -f ($_.Exception.GetType().FullName), ($_.Exception.Message)
Write-host $message
}
For more information about error handling, see the about_Try_Catch_Finally .
dism
Add-Appx
|
Adds an app package (.appx) that will install for each new user to a Windows image. |
Add-Windows
|
Installs a Windows capability package on the specified operating system image. |
Add-Windows
|
Adds a driver to an offline Windows image. |
Add-Windows
|
Adds an additional image to an existing image (.wim) file. |
Add-Windows
|
Adds a single .cab or .msu file to a Windows image. |
Clear-Windows
|
Deletes all of the resources associated with a mounted image that has been corrupted. |
Disable-Windows
|
Disables a feature in a Windows image. |
Dismount-Windows
|
Dismounts a Windows image from the directory it is mapped to. |
Enable-Windows
|
Enables a feature in a Windows image. |
Expand-Windows
|
Expands a custom data image. |
Expand-Windows
|
Applies an image to a specified location. |
Export-Windows
|
Exports all third-party drivers from a Windows image to a destination folder. |
Export-Windows
|
Exports a copy of the specified image to another image file. |
Get-Appx
|
Gets information about app packages (.appx) in an image that will be installed for each new user. |
Get-WIMBoot
|
Displays the Windows image file boot (WIMBoot) configuration entries for a specified disk volume. |
Get-Windows
|
Gets Windows capabilities for an image or a running operating system. |
Get-Windows
|
Displays information about drivers in a Windows image. |
Get-Windows
|
Gets edition information about a Windows image. |
Get-Windows
|
Gets information about a Windows image in a WIM or VHD file. |
Get-Windows
|
Displays a list of the files and folders in a specified image. |
Get-Windows
|
Gets information about optional features in a Windows image. |
Get-Windows
|
Gets information about packages in a Windows image. |
Mount-Windows
|
Mounts a Windows image in a WIM or VHD file to a directory on the local computer. |
New-Windows
|
Captures an image of customized or serviced Windows components on a Windows Image File Boot (WIMBoot) configured device. |
New-Windows
|
Captures an image of a drive to a new WIM file. |
Optimize-Windows
|
Configures a Windows image with specified optimizations. |
Remove-Appx
|
Removes an app package (.appx) from a Windows image. |
Remove-Windows
|
Uninstalls a Windows capability package from an image. |
Remove-Windows
|
Removes a driver from an offline Windows image. |
Remove-Windows
|
Deletes the specified volume image from a WIM file that has multiple volume images. |
Remove-Windows
|
Removes a package from a Windows image. |
Repair-Windows
|
Repairs a Windows image in a WIM or VHD file. |
Save-Windows
|
Applies changes made to a mounted image to its WIM or VHD file. |
Set-App
|
Adds custom data into the specified app (.appx) package that has been provisioned in a Windows image. |
Set-Windows
|
Changes a Windows image to a higher edition. |
Set-Windows
|
Sets the product key for the Windows image. |
Split-Windows
|
Splits an existing .wim file into multiple read-only split .wim files. |
Update-WIMBoot
|
Updates the Windows image file boot (WIMBoot) configuration entry, associated with either the specified data source ID, the renamed image file path or the moved image file path. |
Use-Windows
|
Applies an unattended answer file to a Windows image. |