Skip to content

Latest commit

 

History

History
192 lines (135 loc) · 7.65 KB

File metadata and controls

192 lines (135 loc) · 7.65 KB
description Download Help Link Help Version Locale Module Guid Module Name ms.date title
Use this topic to help manage Windows and Windows Server technologies with Windows PowerShell.
5.0.1.1
en-US
389c464d-8b8d-48e9-aafe-6d8a590d6798
DISM
10/07/2021
DISM

DISM Module

Description

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.

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 Cmdlets

Adds an app package (.appx) that will install for each new user to a Windows image.

Installs a Windows capability package on the specified operating system image.

Adds a driver to an offline Windows image.

Adds an additional image to an existing image (.wim) file.

Adds a single .cab or .msu file to a Windows image.

Deletes all of the resources associated with a mounted image that has been corrupted.

Disables a feature in a Windows image.

Dismounts a Windows image from the directory it is mapped to.

Enables a feature in a Windows image.

Expands a custom data image.

Applies an image to a specified location.

Creates a custom FOD repository that includes packages that support the installation of the specified capabilities.

Exports all third-party drivers from a Windows image to a destination folder.

Exports a copy of the specified image to another image file.

Gets information about app packages (.appx) in an image that will be installed for each new user.

Returns a list of the app packages that are installed and configured as non-removable apps.

Displays the Windows image file boot (WIMBoot) configuration entries for a specified disk volume.

Gets Windows capabilities for an image or a running operating system.

Displays information about drivers in a Windows image.

Gets edition information about a Windows image.

Gets information about a Windows image in a WIM or VHD file.

Displays a list of the files and folders in a specified image.

Gets information about optional features in a Windows image.

Gets information about packages in a Windows image.

Gets the reserved storage state of the image.

Mounts a Windows image in a WIM or VHD file to a directory on the local computer.

Captures an image of customized or serviced Windows components on a Windows Image File Boot (WIMBoot) configured device.

Captures an image of a drive to a new WIM file.

Optimizes the total file size of provisioned packages on the image by replacing identical files with hard links.

Configures a Windows image with specified optimizations.

Removes an app package (.appx) from a Windows image.

Uninstalls a Windows capability package from an image.

Removes a driver from an offline Windows image.

Deletes the specified volume image from a WIM file that has multiple volume images.

Removes a package from a Windows image.

Repairs a Windows image in a WIM or VHD file.

Applies changes made to a mounted image to its WIM or VHD file.

Adds custom data into the specified app (.appx) package that has been provisioned in a Windows image.

Sets an app package as non-removable (can not be uninstalled).

Changes a Windows image to a higher edition.

Sets the product key for the Windows image.

Sets the reserved storage state of the image.

Splits an existing .wim file into multiple read-only split .wim files.

Windows gives a user the ability to uninstall and roll back to a previous version of Windows. You can use DISM to initiate an uninstall.

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.

Applies an unattended answer file to a Windows image.