
close
close
Chance to win $250 in Petri 2023 Audience Survey
For a while now IT pros have used the command-line tool DISM.EXE to manage Windows images and installations, which isn’t an especially difficult tool to use. Because it is a command line tool, everything it outputs is text, and this can make it tricky if you are trying to do anything with it. Fortunately, Windows 8 brought us a new module, conveniently called DISM. Let me introduce you to it and use some of the commands to adjust my desktop settings.
DISM isn’t required anymore because PowerShell automatically imports modules when you use one of its commands. But you probably don’t know what those commands are called, so we’ll go ahead and explicitly import the module.
import-module dism
What can the module do for us?
get-command -Module DISM
Looks like quite a lot.
DISM PowerShell cmdlets. (Image Credit: Jeff Hicks)
get-command -Module DISM | sort Noun,Verb | format-table -GroupBy Noun
DISM PowerShell cmdlets. (Image Credit: Jeff Hicks)
help Get-WindowsEdition –online
Let’s try this one.
Get-windowsedition –online
The get-windowsedition cmdlet. (Image Credit: Jeff Hicks)
Programs and features dialog. (Image Credit: Jeff Hicks)
Turn Windows features on or off. (Image Credit: Jeff Hicks)
Get-WindowsOptionalFeature –Online
The get-windowsoptionalfeature cmdlet in Windows PowerShell. (Image Credit: Jeff Hicks)
The get-windowsoptionalfeature cmdlet in Windows PowerShell. (Image Credit: Jeff Hicks)
Get-WindowsOptionalFeature -FeatureName TelnetClient –Online
The Telnet Client allows you to connect to other computers remotely. (Image Credit: Jeff Hicks)
Enable-WindowsOptionalFeature -FeatureName TelnetClient –Online
This particular feature installs quickly and doesn’t require a reboot.
The Enable-WindowsOptionalFeature cmdlet. (Image Credit: Jeff Hicks)
The Telnet client has successfully installed. (Image Credit: Jeff Hicks)
get-windowsoptionalfeature -FeatureName *PowerShell* -Online
Scrolling down I see the features.
I want to remove the highlighted features. Let’s refine my wildcard pattern and disable the matching features.
Get-WindowsOptionalFeature -FeatureName MicrosoftWindowsPowerShellV2* -Online | Disable-WindowsOptionalFeature –Online
Disabling matching features. (Image Credit: Jeff Hicks)
More in PowerShell
Most popular on petri