PowerShell Logo Small


This is the built-in help made by Microsoft for the command 'Enable-WindowsOptionalFeature', in PowerShell version 5 - as retrieved from Windows version 'Microsoft Windows Server 2012 R2 Standard' PowerShell help files on 2016-06-23.

For PowerShell version 3 and up, where you have Update-Help, this command was run just before creating the web pages from the help files.


Enables a feature in a Windows image.


Enable-WindowsOptionalFeature [-All] [-LimitAccess] [-LogLevel <LogLevel>] [-LogPath <String>] [-NoRestart] [-PackageName <String>] [-ScratchDirectory <String>] [-Source
<String[]>] [-SystemDrive <String>] [-WindowsDirectory <String>] -FeatureName <String[]> -Online [<CommonParameters>]
Enable-WindowsOptionalFeature [-All] [-LimitAccess] [-LogLevel <LogLevel>] [-LogPath <String>] [-NoRestart] [-PackageName <String>] [-ScratchDirectory <String>] [-Source
<String[]>] [-SystemDrive <String>] [-WindowsDirectory <String>] -FeatureName <String[]> -Path <String> [<CommonParameters>]

Search powershellhelp.space


The Enable-WindowsOptionalFeature cmdlet enables or restores an optional feature in a Windows image.

Use the Online parameter to specify the running operating system on your local computer, or use the Path parameter to specify the location of a mounted Windows image.

The PackageName parameter specifies the package that the feature is a component of. This parameter is optional when the package is the Windows Foundation package.

The FeatureName parameter specifies the feature to add. You can specify more than one feature in the same package. Separate feature names with a comma.

The Source parameter specifies the location of files that are needed to restore a removed feature.

The LimitAccess parameter prevents access to WindowsUpdate (WU) as a Source for restoring features to online images. The All parameter enables all parent features of the
specified feature before enabling the specified feature. The parent feature will be enabled with default values.



Online Version: http://go.microsoft.com/fwlink/p/?linkid=289353




Example 1

PS C:\>Enable-WindowsOptionalFeature –Online –FeatureName Hearts -All

This command enables the optional feature, Hearts, the parent feature for Hearts, and the dependencies for the parent feature in the running Windows operating system.

Example 2

PS C:\>Enable-WindowsOptionalFeature –Path c:\offline –FeatureName Calc –PackageName Microsoft.Windows.Calc.Demo~6595b6144ccf1df~x86~en~

This command enables the optional feature, Calc, in the specified package in the Windows image that is mounted to c:\offline.

Example 3

PS C:\>Enable-WindowsOptionalFeature –Online –FeatureName MyFeature –Source c:\test\mount -LimitAccess

This command restores the optional feature, MyFeature, to the Windows image that is mounted to c:\offline using source files from another Windows image that is mounted to
c:\test\mount. If the files are not found in the source image, this command specifies not to check WindowsUpdate for the source files.