How to use PowerShell with DISM

DISM is the Swiss Army Knife of Windows 10 maintenance and with the Windows 10 Creators Update it gained a helpful collection of PowerShell scripts. Here's how to put them to use.

red swiss army knife with miniature business men
Thinkstock

With the release of the Windows 10 Creators Update in early April, Microsoft changed the default command-line environment in Windows 10 from the Command Prompt (aka cmd.exe) to PowerShell. There, the old black-and-white command-line interface gives way to a new, blue-and-white style in the latest version of Windows 10.

But the powerful Deployment Image Servicing and Management (DISM) command that I've described as theSwiss Army Knife of Windows 10 maintenancegot more than a new color; it gained a collection of PowerShell scripts — called "cmdlets" (pronounced "command-lets") in PowerShell-speak – that go a long way toward simplifying its syntax and usage.

DISM Repair-WindowsImage Ed Tittel

Figure 1:DISM Repair-WindowsImage -CheckHealth remains key to figuring out if image repairs are needed (and feasible).

Where to look for DISM-related cmdlets

As it happens, there's a peachy guide to the whole panoply of DISM commands as they map into equivalent PowerShell cmdlets. It's online at the MSDN Hardware Dev Center, and it's called "Use DISM in Windows PowerShell." There are multiple versions of this document around, so grab one that's been updated on or after January 3, 2017 to be sure you get the most current version for Windows 10 and Windows Server 2016.

Basically, this document consists of a table with 45 entries, each of which corresponds to a particular variant of the DISM command. What you won't find there are the syntax details, so it's best to turn to the online "get-help" cmdlet via PowerShell. Not only is this handy and convenient, but PowerShell will also download the most current help files for all cmdlets with your permission each time you use it. This takes a while (a couple of minutes on my test Lenovo X220 Tablet PC), but it's worth the wait. Here's an example of the output for the get-help cmdlet illustrated in Figure 1.

To continue reading this article register now

IT Salary Survey:The results are in