PowerShell Logo Small

Enable-WindowsOptionalFeature



This is the built-in help made by Microsoft for the command 'Enable-WindowsOptionalFeature', in PowerShell version 4 - as retrieved from Windows version 'Microsoft Windows 8.1 Enterprise' 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.

SYNOPSIS

Enables a feature in a Windows image.

SYNTAX


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



Search powershellhelp.space

DESCRIPTION


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 Windows Update (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.



<

RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/p/?linkid=289353
Disable-WindowsOptionalFeature
Get-WindowsOptionalFeature
Add-WindowsPackage

REMARKS

<

Examples


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~1.0.0.0



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 mounte
d to c:\test\mount. If the files are not found in the source image, this command specifies not to check Windows Update for the source files.