2 out of 8 rated this helpful - Rate this topic

Add-WindowsFeature

Add-WindowsFeature


The Add-WindowsFeature cmdlet allows you to install specified roles, role
services, and features on a computer that is running Windows Server 2008
R2.

Syntax

Add-WindowsFeature [-Name] <string[]> [-IncludeAllSubFeature] [-logPath <string>] [-WhatIf] [-Restart] [-Concurrent] [<CommonParameters>]

Detailed Description


The Add-WindowsFeature cmdlet allows you to install specified roles, role
services, and features on a computer that is running Windows Server 2008
R2. The Add-WindowsFeature cmdlet functions similarly to the Add Roles
Wizard and Add Features Wizard that you can start from the Server Manager
UI. As in those wizards, you can add more than one role, role service, or
feature per session, and all roles, role services, or features that are
required by those Windows features you want to install are added
automatically.

You can find a list of command IDs for all roles, role services, and
features in the topic "Overview of Server Manager Commands" in the Server
Manager Help.

Parameters

-Name


Specifies the command IDs of roles, role services, or features you
want to install by using the Add-WindowsFeature cmdlet. Alternatively,
an array of Feature objects will also be accepted.

You can find a list of command IDs for all roles, role services, and
features in the topic "Overview of Server Manager Commands" in the
Server Manager Help.

Attributes

Name Value

Required?

true

Accept wildcard characters?

false

Accept Pipeline Input?

true (ByValue)

Position?

1

-IncludeAllSubFeature


Specifies the installation of all subordinate services and features
along with the parent role, role service, or feature named in the
Name parameter.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-logPath


Specifies a name and location for the log file, other than the
default, %windir%\logs\ServerManager.log.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-WhatIf


Displays any operations that are specified for the Add-WindowsFeature
cmdlet; for example, displays the Windows features that are also
installed because the role, role service, or feature you want to
install is dependent upon them.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-Restart


Restarts the computer automatically when installation is complete,
if restarting is required by the roles or features installed.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-Concurrent


Allows concurrent instances of the Server Manager Add-WindowsFeature
or Remove-WindowsFeature cmdlets to be running at the same time.
Do not add this parameter unless you are installing roles, role
services, or features that are downloaded separately from Windows
Server 2008 R2, and you want to install Windows features on which
the downloaded technology depends at the same time.

The use of this switch is not recommended. This switch is intended
for out-of-band feature(s) to install their dependencies.

Attributes

Name Value

Required?

false

Accept wildcard characters?

false

Accept Pipeline Input?

false

Position?

named

-CommonParameter

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see About Common Parameter

Input and Return Types

The input type is the type of the objects that you can pipe to the cmdlet. The return type is the type of the objects that the cmdlet emits.

Input Type

string[]. Array of strings.

Return Type

Microsoft.Windows.ServerManager.Commands.FeatureOperationResult. FeatureOperationResult object

Notes

The -Confirm parameter is not used by this cmdlet, because multiple roles, role services, or features can be installed in a single session.



Examples

Example 1

Add-WindowsFeature Telnet-Server,Telnet-Client

Install both Telnet Server and Telnet Client.

Example 2

Get-WindowsFeature Web-* | Add-WindowsFeature

Install all Web features.

See Also

Reference

Get-WindowsFeature

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.