Use DISM in Windows PowerShell
Updated: October 20, 2013
Applies To: Windows 8, Windows 8.1, Windows Server 2012, Windows Server 2012 R2
The Deployment Image Servicing and Management (DISM) PowerShell cmdlets can be used to perform the same functions as the DISM.exe command-line tool. In many cases, the DISM PowerShell cmdlet names correspond directly to Dism.exe options and the same arguments can be used.
The DISM PowerShell module is included in Windows 8.1 and Windows Server 2012 R2. On other supported operating systems, you can install the Windows Assessment and Deployment Kit (Windows ADK) which includes the DISM PowerShell module. For more information, see Installing the Windows ADK.
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.
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.
Import the DISM PowerShell module.
The DISM PowerShell module is included in Windows 8.1 and Windows Server 2012 R2 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\8.1\Assessment and Deployment Kit\Deployment Tools\, in Windows 8.1, and C:\Program Files (x86)\Windows Kits\8.0\Assessment and Deployment Kit\Deployment Tools\, in Windows 8. To import this module, at the command prompt, type:
import-module <path to DISM folder>
For example, using the Windows 8.1 version of the Windows ADK on a 64-bit PC type:
import-module "C:\Program Files (x86)\Windows Kits\8.1\Assessment and Deployment Kit\Deployment Tools\amd64\DISM"
Import-Module imports a module only into the current session. To import the module into all sessions, add an Import-Module command to your Windows PowerShell profile. For more information about profiles, type
%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 Windows 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.
ReferenceDISM Supported Platforms
Other ResourcesDISM - Deployment Image Servicing and Management Technical Reference