Enable a Windows Optional Feature from the Command Line

Turn on optional Windows features like the Telnet client or .NET 3.5 with Enable-WindowsOptionalFeature or DISM /enable-feature.

WindowssystempowershelldismMedium risk
Run Enable-WindowsOptionalFeature -Online -FeatureName <FeatureName> in an admin PowerShell (e.g. TelnetClient); the equivalent cmd tool is dism /online /enable-feature /featurename:<FeatureName>.

01Command

Command
$ Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient -NoRestart

02What it does

The feature names you pass here are the exact names shown by Get-WindowsOptionalFeature -Online, not the friendly names in the dialog — TelnetClient, Microsoft-Windows-Subsystem-Linux, NetFx3 and so on. Add -All to pull in the feature's parent dependencies, and -NoRestart if you don't want the machine to reboot automatically when the feature requests it. Features whose payload was removed (like .NET 3.5 on some installs) need -Source pointing at installation media or Windows Update.

03Risk

RiskMedium risk
RequirementsRun PowerShell as administrator. Some features require a restart or the Windows installation media (-Source).
!Warning: Enabling server-oriented features such as Hyper-V can change virtualization and boot configuration. Only enable features you recognize, and run from an elevated prompt.

04Undo

Undo
$ Disable-WindowsOptionalFeature -Online -FeatureName TelnetClient

05Sources

  • Enable-WindowsOptionalFeature
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: Documents Enable-WindowsOptionalFeature -Online -FeatureName <name> with -NoRestart, -All and -Source parameters for enabling optional features.
  • DISM Operating System Package Servicing Command-Line Options
    Microsoft Learn · vendor-doc · 2026-09-17
    Evidence: The equivalent DISM syntax (dism /online /enable-feature /featurename:<name>) for environments that use the DISM tool directly.

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions