
close
close
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?
advertisment
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)
advertisment
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.
advertisment
Get-WindowsOptionalFeature -FeatureName MicrosoftWindowsPowerShellV2* -Online | Disable-WindowsOptionalFeature –Online
Disabling matching features. (Image Credit: Jeff Hicks)
More from Jeff Hicks
advertisment
Petri Newsletters
Whether it’s Security or Cloud Computing, we have the know-how for you. Sign up for our newsletters here.
advertisment
More in PowerShell
Microsoft’s New PowerShell Crescendo Tool Facilitates Native Command-Line Wraps
Mar 21, 2022 | Rabia Noureen
Most popular on petri
Log in to save content to your profile.
Article saved!
Access saved content from your profile page. View Saved
Join The Conversation
Create a free account today to participate in forum conversations, comment on posts and more.
Copyright ©2019 BWW Media Group