Use DISM in Windows PowerShell

The Deployment Image Servicing and Management (DISM) cmdlets can be used to perform the same functions as the DISM.exe command-line tool. In many cases, the DISM cmdlet names correspond directly to Dism.exe options and the same arguments can be used. Because there are also cases where the DISM cmdlet names do not correspond directly to Dism.exe options, a table that maps the Dism.exe commands to DISM cmdlets is provided here:

Dism.exe command DISM cmdlet

Dism.exe /Add-Capability

Add-WindowsCapability

Dism.exe /Append-Image

Add-WindowsImage

Dism.exe /Apply-Image

Expand-WindowsImage

Dism.exe /Capture-Image

New-WindowsImage

Dism.exe /Cleanup-MountPoints

Clear-WindowsCorruptMountPoint

Dism.exe /Commit-Image

Save-WindowsImage

Dism.exe /Export-Image

Export-WindowsImage

Dism.exe /Get-Capabilities

Get-WindowsCapability

Dism.exe /Get-ImageInfo

Get-WindowsImage

Dism.exe /Get-MountedImageInfo

Get-WindowsImage -Mounted

Dism.exe /Get-WimBootEntry

Get-WIMBootEntry

Dism.exe /List-Image

Get-WindowsImageContent

Dism.exe /Mount-Image

Mount-WindowsImage

Dism.exe /Split-Image

Split-WindowsImage

Dism.exe /Remove-Capability

Remove-WindowsCapability

Dism.exe /Remove-Image

Remove-WindowsImage

Dism.exe /Remount-Image

Mount-WindowsImage -Remount

Dism.exe /Unmount-Image

Dismount-WindowsImage

Dism.exe /Update-WimBootEntry

Update-WIMBootEntry

Dism.exe /Image:<…> /Add-Driver

Add-WindowsDriver

Dism.exe /Image:<...> /Add-Package

Add-WindowsPackage

Dism.exe /Image:<...> /Add-ProvisionedAppxPackage

Add-AppxProvisionedPackage

Dism.exe /Image:<...> /Apply-Unattend

Apply-WindowsUnattend

Dism.exe /Image:<...> /Cleanup-Image /CheckHealth

Repair-WindowsImage -CheckHealth

Dism.exe /Image:<...> /Cleanup-Image /ScanHealth

Repair-WindowsImage -ScanHealth

Dism.exe /Image:<...> /Cleanup-Image /RestoreHealth

Repair-WindowsImage -RestoreHealth

Dism.exe /Image:<...> /Disable-Feature

Disable-WindowsOptionalFeature

Dism.exe /Image:<...> /Enable-Feature

Enable-WindowsOptionalFeature

Dism.exe /Image:<...> /Export-Driver

Export-WindowsDriver

Dism.exe /Image:<...> /Get-CurrentEdition

Get-WindowsEdition -Current

Dism.exe /Image:<...> /Get-Driverinfo

Get-WindowsDriver -Driver

Dism.exe /Image:<...> /Get-Drivers

Get-WindowsDriver

Dism.exe /Image:<...> /Get-Featureinfo

Get-WindowsOptionalFeature -FeatureName

Dism.exe /Image:<...> /Get-Features

Get-WindowsOptionalFeature

Dism.exe /Image:<...> /Get-Packageinfo

Get-WindowsPackage -PackagePath | -PackageName

Dism.exe /Image:<...> /Get-Packages

Get-WindowsPackage

Dism.exe /Image:<...> /Get-ProvisionedAppxPackages

Get-AppxProvisionedPackage

Dism.exe /Image:<...> /Get-TargetEditions

Get-WindowsEdition -Target

Dism.exe /Image:<...> /Optimize-Image

Optimize-WindowsImage

Dism.exe /Image:<...> /Remove-Driver

Remove-WindowsDriver

Dism.exe /Image:<...> /Remove-Package

Remove-WindowsPackage

Dism.exe /Image:<...> /Remove-ProvisionedAppxPackage

Remove-AppxProvisionedPackage

Dism.exe /Image:<...> /Set-Edition

Set-WindowsEdition

Dism.exe /Image:<...> /Set-ProductKey

Set-WindowsProductKey

Dism.exe /Image:<...> /Set-ProvisionedAppxDataFile

Set-AppXProvisionedDataFile

Install the Windows Assessment and Deployment Kit (Optional)

The DISM PowerShell module is included in Windows 10 and Windows Server 2016. On other supported operating systems, you can install the Windows Assessment and Deployment Kit (ADK) which includes the DISM PowerShell module.

Install Windows PowerShell 5.0

For Windows 10 and Windows Server 2016, Windows Powershell 5.0 is included in the installation. For other older supported versions of Windows and Windows Server, you must install Windows Management Framework 5.0. You can download and install Windows Management Framework 5.0 from the Microsoft Download Center.

To prepare the DISM PowerShell Environment

  1. To open PowerShell with administrator privileges, on the Start screen, type PowerShell, right-click the Windows PowerShell app tile, and then, in the app bar, click Run as administrator.

  2. Import the DISM PowerShell module.

    The DISM PowerShell module is included in Windows 10 and Windows Server 2016 and does not need to be imported.

    On other supported operating systems, you can use the DISM PowerShell module included in the Windows ADK. By default, the module is installed with the Windows ADK in the DISM folder at <x86 or amd64>\DISM\ under the path: C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\ in Windows 10. To import this module, at the command prompt, type:

    import-module <path to DISM folder>
    

    For example, using the Windows 10 version of the Windows ADK on a 64-bit PC type:

    import-module "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM"
    

    Note
    Import-Module imports a module only into the current session. To import the module into all sessions, add an Import-Module command to your PowerShell profile. For more information about profiles, type get-help about_profiles.

  3. Set the %path% environment variable to the location of the DISM folder in the Windows ADK installation. At the command prompt, type:

    $env:path = <path to DISM folder>
    

    When you change environment variables in PowerShell, the change affects only the current session. To make a persistent change to an environment variable that stores the change in the registry, use System in Control Panel. For more information, see To add or change the values of environment variables.

To get Help for DISM PowerShell cmdlets

To get the syntax to use with a cmdlet, at a command prompt, type:

get-help <cmdlet name>

For example, type:

get-help get-WindowsImage

Related topics

DISM - Deployment Image Servicing and Management Technical Reference for Windows

DISM Supported Platforms