Software & OS

Windows Features Turn On or Off: GUI, PowerShell and DISM

To turn Windows features on or off, open Control Panel, go to Programs, then Programs and Features, and select Turn Windows features on or off. To do the same from an elevated PowerShell window, run Enable-WindowsOptionalFeature -Online -FeatureName <name> -All to turn a feature on and Disable-WindowsOptionalFeature -Online -FeatureName <name> to turn it off.

The commands below were taken from Microsoft's documentation, not run for this article. Any output shown is example output.

Turn Windows features on or off in Control Panel

This is the route Microsoft documents for Windows 11:

  1. Select Start, search for Control Panel and open it.
  2. Select Programs, then Programs and Features.
  3. Select Turn Windows features on or off.
  4. Tick the feature you want (or clear the box to turn it off), then select OK.

On Windows 10 the path to the same dialog is Settings, then Apps & features, then Programs and Features, then Turn Windows features on or off. When the change finishes, Windows may prompt you to restart. Microsoft's Hyper-V instructions say you are prompted to restart on Windows 11 and tell you to restart on Windows 10.

Turn a feature on with PowerShell

Open Windows PowerShell as administrator (right-click it, then Run as Administrator). Microsoft's note is blunt: you must run PowerShell as an administrator, or the commands fail.

First list the features and their exact names:

Get-WindowsOptionalFeature -Online

Example output (names and states depend on your edition and what you have already changed):

FeatureName : Microsoft-Hyper-V
State       : Disabled

FeatureName : VirtualMachinePlatform
State       : Enabled

To look at one feature, or all features matching a pattern, add -FeatureName. Microsoft's own example uses a wildcard:

Get-WindowsOptionalFeature -Online -FeatureName *Hyper-V*

Then turn the feature on. This is Microsoft's command for Hyper-V:

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

-Online means the running operating system, as opposed to a mounted image. -All enables the parent features the feature depends on, with their default values. If a restart is needed, PowerShell asks. Answering Y restarts the computer to finish the installation. Add -NoRestart if you want to restart yourself later.

Turn a feature off with PowerShell

The matching cmdlet is Disable-WindowsOptionalFeature, which Microsoft lists as the related cmdlet to Enable-WindowsOptionalFeature:

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V

Run it from an elevated window and restart when asked.

Turn features on or off with DISM

DISM works from Command Prompt or PowerShell, again as administrator. Microsoft's reference page uses the TFTP feature as its example. List everything, or inspect one feature:

Dism /online /Get-Features
Dism /online /Get-FeatureInfo /FeatureName:TFTP

Add > featurelist.txt to the first command to save the list to a text file. Turn a feature on, including its parents:

Dism /online /Enable-Feature /FeatureName:TFTP /All

Turn it off:

Dism /online /Disable-Feature /FeatureName:TFTP

The Hyper-V article gives the same pattern for a real feature, and says a successful run ends with "The operation completed successfully.":

DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V

Check the result at any time with Dism /online /Get-FeatureInfo /FeatureName:TFTP. A status of EnablePending or DisablePending means the machine must restart before the change is complete.

Feature names for common requests

These names appear in Microsoft's documentation. Use them with -FeatureName or /FeatureName:.

Feature in the dialogName to useNotes
Hyper-VMicrosoft-Hyper-VNot available on Windows 10 or 11 Home
Windows Subsystem for LinuxMicrosoft-Windows-Subsystem-LinuxMicrosoft's manual install uses /all /norestart
Virtual Machine PlatformVirtualMachinePlatformNeeded for WSL 2; needs hardware virtualization

For the two WSL features, Microsoft's manual steps are:

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

Restart afterwards to complete the install. On current Windows builds wsl --install is the simpler route; see how to install WSL on Windows 10 and 11.

Restore a feature whose files are missing

If the files for a feature are not on the machine, Windows looks in the default location set by Group Policy, then contacts Windows Update. Two switches control that. /LimitAccess (PowerShell: -LimitAccess) stops DISM from contacting Windows Update. /Source (PowerShell: -Source) points at another location, such as a mounted image. If you give several sources, the first one that has the files is used and the rest are ignored. Microsoft's example:

Dism /Online /Enable-Feature /FeatureName:TFTP /Source:Z:\sources\SxS /Source:C:\test\mount\windows /LimitAccess

Does turning a feature off free disk space?

Not on a Windows client. /Disable-Feature with /Remove marks a feature as removed for on-demand installation and its status becomes Disabled. Microsoft states that since Windows 10 the payload is not removed from client editions, to support push-button reset. Only Windows Server installations lose the payload. If you want to turn a feature off for a security or performance reason, plain disabling is enough.

If the feature is missing or the command fails

  • The feature isn't listed. Run Get-WindowsOptionalFeature -Online and read the real name from the output. Hyper-V is a known case: it does not exist as an installable role on Home editions.
  • The command fails immediately. You are probably not elevated. Reopen PowerShell or Command Prompt with Run as Administrator.
  • A parent feature is off. Repeat the enable command with -All (PowerShell) or /All (DISM).
  • The feature shows as pending. Restart, then check again with Get-FeatureInfo as shown above.
  • Files can't be found. Use the /Source and /LimitAccess switches above, or make sure the machine can reach Windows Update.

Virtualization software can also be affected. Microsoft notes that third-party virtualization apps such as VMware Workstation and VirtualBox rely on processor features Hyper-V needs, so their virtual machines might not start or might run unreliably while the Hyper-V hypervisor is running.

Frequently asked questions

Why is Hyper-V missing from the Windows features list?
The Hyper-V role can't be installed on Windows 10 Home or Windows 11 Home. Microsoft lists Windows 10 or 11 Pro or Enterprise as the requirement, so on Home the entry does not appear.
Do I have to restart after changing a Windows feature?
Often, yes. DISM reports a status of EnablePending or DisablePending when the machine must restart before the change takes full effect. You can suppress the restart prompt with /NoRestart in DISM or -NoRestart in PowerShell and restart later.
What does the -All switch do when enabling a feature?
-All (DISM: /All) also enables every parent feature that the one you asked for depends on, using default settings for those parents. Without it, the command can fail when a required parent feature is off.
Does turning a feature off free up disk space?
Not on Windows client editions. Microsoft states that since Windows 10 the payload is not removed from client editions, even with the /Remove option, to support push-button reset. The payload is removed on Windows Server.
Do I need administrator rights to turn features on or off?
Yes. Microsoft's instructions for both the PowerShell and DISM routes say to open the shell as administrator, and note that the commands fail otherwise.

Sources