Skip to main content

Use Windows PowerShell to install optional features

Microsoft Windows ships with a set of so-called optional features that users may enable or disable using the "turn Windows features on or off" control panel applet.

This works well for the most part, but requires that you open the Control Panel on the operating system unless you load the Features window directly by typing optionalfeatures in Start.

While that is sufficient most of the time, administrators may use PowerShell as well to manage optional features of the Windows operating system.

The following guide provides you with an overview on how that works on Windows 10. Note that this may not work on previous versions of Windows such as Windows 7.

Windows PowerShell: install optional features

You need an elevated PowerShell for the following commands. Tap on the Windows-key, type powershell, hold down the Ctrl-key and the Shift-key, and tap on the Enter-key to open a PowerShell prompt with administrative privileges.

List all optional features and their status

powershell optional features

The first thing you may want to do, at least when you are new to using the command, is to display the list of features that are available.

Run get-windowsoptionalfeature -online to list all available feature names and their states on the computer system. The state is either enabled or disabled.

Note: the -online parameter means that the actions are run on the current device.

While it is easy enough to identify some features by the feature name, it is not easy for all of them.

The following list is from a Windows 10 Pro version 1703 PC.

FeatureName : Microsoft-Windows-HyperV-Guest-Package
FeatureName : LegacyComponents
FeatureName : DirectPlay
FeatureName : SimpleTCP
FeatureName : SNMP
FeatureName : WMISnmpProvider
FeatureName : MicrosoftWindowsPowerShellV2Root
FeatureName : MicrosoftWindowsPowerShellV2
FeatureName : Windows-Identity-Foundation
FeatureName : Microsoft-Windows-Subsystem-Linux
FeatureName : NetFx3
FeatureName : IIS-WebServerRole
FeatureName : IIS-WebServer
FeatureName : IIS-CommonHttpFeatures
FeatureName : IIS-HttpErrors
FeatureName : IIS-HttpRedirect
FeatureName : IIS-ApplicationDevelopment
FeatureName : IIS-NetFxExtensibility
FeatureName : IIS-NetFxExtensibility45
FeatureName : IIS-HealthAndDiagnostics
FeatureName : IIS-HttpLogging
FeatureName : IIS-LoggingLibraries
FeatureName : IIS-RequestMonitor
FeatureName : IIS-HttpTracing
FeatureName : IIS-Security
FeatureName : IIS-URLAuthorization
FeatureName : IIS-RequestFiltering
FeatureName : IIS-IPSecurity
FeatureName : IIS-Performance
FeatureName : IIS-HttpCompressionDynamic
FeatureName : IIS-WebServerManagementTools
FeatureName : IIS-ManagementScriptingTools
FeatureName : IIS-IIS6ManagementCompatibility
FeatureName : IIS-Metabase
FeatureName : WAS-WindowsActivationService
FeatureName : WAS-ProcessModel
FeatureName : WAS-NetFxEnvironment
FeatureName : WAS-ConfigurationAPI
FeatureName : IIS-HostableWebCore
FeatureName : WCF-HTTP-Activation
FeatureName : WCF-NonHTTP-Activation
FeatureName : WCF-Services45
FeatureName : WCF-HTTP-Activation45
FeatureName : WCF-TCP-Activation45
FeatureName : WCF-Pipe-Activation45
FeatureName : WCF-MSMQ-Activation45
FeatureName : WCF-TCP-PortSharing45
FeatureName : IIS-CertProvider
FeatureName : IIS-WindowsAuthentication
FeatureName : IIS-DigestAuthentication
FeatureName : IIS-ClientCertificateMappingAuthentication
FeatureName : IIS-IISCertificateMappingAuthentication
FeatureName : IIS-ODBCLogging
FeatureName : IIS-StaticContent
FeatureName : IIS-DefaultDocument
FeatureName : IIS-DirectoryBrowsing
FeatureName : IIS-WebDAV
FeatureName : IIS-WebSockets
FeatureName : IIS-ApplicationInit
FeatureName : IIS-ASPNET
FeatureName : IIS-ASPNET45
FeatureName : IIS-ASP
FeatureName : IIS-CGI
FeatureName : IIS-ISAPIExtensions
FeatureName : IIS-ISAPIFilter
FeatureName : IIS-ServerSideIncludes
FeatureName : IIS-CustomLogging
FeatureName : IIS-BasicAuthentication
FeatureName : IIS-HttpCompressionStatic
FeatureName : IIS-ManagementConsole
FeatureName : IIS-ManagementService
FeatureName : IIS-WMICompatibility
FeatureName : IIS-LegacyScripts
FeatureName : IIS-LegacySnapIn
FeatureName : IIS-FTPServer
FeatureName : IIS-FTPSvc
FeatureName : IIS-FTPExtensibility
FeatureName : MSMQ-Container
FeatureName : MSMQ-Server
FeatureName : MSMQ-Triggers
FeatureName : MSMQ-ADIntegration
FeatureName : MSMQ-HTTP
FeatureName : MSMQ-Multicast
FeatureName : MSMQ-DCOMProxy
FeatureName : NetFx4-AdvSrvs
FeatureName : NetFx4Extended-ASPNET45
FeatureName : MediaPlayback
FeatureName : WindowsMediaPlayer
FeatureName : Printing-PrintToPDFServices-Features
FeatureName : Printing-XPSServices-Features
FeatureName : RasRip
FeatureName : MSRDC-Infrastructure
FeatureName : SearchEngine-Client-Package
FeatureName : TelnetClient
FeatureName : TFTP
FeatureName : Xps-Foundation-Xps-Viewer
FeatureName : WorkFolders-Client
FeatureName : SMB1Protocol
FeatureName : Microsoft-Hyper-V-All
FeatureName : Microsoft-Hyper-V-Tools-All
FeatureName : Microsoft-Hyper-V-Management-Clients
FeatureName : Microsoft-Hyper-V-Management-PowerShell
FeatureName : Microsoft-Hyper-V
FeatureName : Microsoft-Hyper-V-Hypervisor
FeatureName : Microsoft-Hyper-V-Services
FeatureName : Printing-Foundation-Features
FeatureName : Printing-Foundation-LPRPortMonitor
FeatureName : Printing-Foundation-LPDPrintService
FeatureName : Printing-Foundation-InternetPrinting-Client
FeatureName : FaxServicesClientPackage
FeatureName : ScanManagementConsole
FeatureName : DirectoryServices-ADAM-Client
FeatureName : ServicesForNFS-ClientOnly
FeatureName : ClientForNFS-Infrastructure
FeatureName : NFS-Administration
FeatureName : RasCMAK
FeatureName : SmbDirect
FeatureName : Containers
FeatureName : DataCenterBridging
FeatureName : TIFFIFilter
FeatureName : Client-DeviceLockdown
FeatureName : Client-EmbeddedShellLauncher
FeatureName : Client-EmbeddedBootExp
FeatureName : Client-EmbeddedLogon
FeatureName : Client-KeyboardFilter
FeatureName : Client-UnifiedWriteFilter
FeatureName : MultiPoint-Connector
FeatureName : MultiPoint-Connector-Services
FeatureName : MultiPoint-Tools
FeatureName : Internet-Explorer-Optional-amd64

Display information about features

powershell-display information about features

You may use the -featurename Example parameter to display detailed information about a feature that you are interested in.

The command get-windowsoptionalfeature -online -featurename NetFx3 for instance reveals that this installs the .Net Framework 3.5 on the system. There is also an Internet link provided that you may click on to look up additional information online.

Enable or disable an optional feature

You may use PowerShell commands to enable or disable optional features on a Windows 10 machine.

The commands Enable-WindowsOptionalFeature -FeatureName and Disable-WindowsOptionalFeature -FeatureName are used for that.

To give you two examples to show you how that works:

  • Enable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -All -- This command installs the Net Framework 3.5 on the computer the command is run on.
  • Disable-WindowsOptionalFeature -Online -FeatureName "NetFx3" -- This command disables the feature again.

The -All parameter tells Windows to install any dependencies as well. So, if a parent feature is required for the installation of the selected feature, it is installed as well. Note: Disable does not support the -All parameter.

Resources

 

This article was first seen on ComTek's "TekBits" Technology News

HOME