Deployment Imaging Servicing Management (DISM) Cmdlets in Windows PowerShell
Mis à jour: août 2015
S'applique à: Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2
Windows PowerShell® est un interpréteur en ligne de commande et un langage de script basé sur des tâches, conçu spécialement pour l’administration système. Cette rubrique de référence pour les informaticiens fournit une assistance sur l’utilisation des applets de commande Windows PowerShell pour écrire des scripts et automatiser des tâches.
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.
DISM
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 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.
Cmdlet | Description |
---|---|
Adds an app package (.appx) that will install for each new user to a Windows 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 that are associated with a mounted image that has been corrupted. |
|
Disables a feature in a Windows image. |
|
Dismounts a Windows image from the directory that it is mapped to. |
|
Enables a feature in a Windows image. |
|
Expands an image to a specified location. |
|
Exports a copy of the specified image to another file. |
|
Gets information about app packages (.appx) that are set to install for each new user in an image. |
|
Gets 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. |
|
Mounts a Windows image in a WIM or VHD file to a directory on the local computer. |
|
Captures an image of a drive to a new WIM file. |
|
Removes app packages (.appx) from a Windows image. |
|
Removes a driver from an offline Windows image. |
|
Removes 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. |
|
Changes a Windows image to a higher edition. |
|
Sets the product key for the Windows image. |
|
Splits an existing .wim file into multiple read-only split .wim files. |
|
Applies an unattended answer file to a Windows image. |
Notes
To list all the cmdlets that are available, use the Get-Command –Module Dism
cmdlet.
Pour plus d’informations sur les applets de commande ou leur syntaxe, utilisez l’applet de commande Get-Help
<nom de l’applet de commande>, où <nom de l’applet de commande> est le nom de l’applet de commande que vous voulez rechercher. Pour plus d’informations, vous pouvez exécuter les applets de commande suivantes :
● Get-Help
<nom de l’applet de commande> -Detailed
● Get-Help
<nom de l’applet de commande> -Examples
● Get-Help
<nom de l’applet de commande> -Full
See Also
Other Resources
Deployment Image Servicing and Management (DISM) Technical Reference
DISM API
Windows Assessment and Deployment Kit (Windows ADK)