Remove-WindowsFeature

Applies To: Windows Server 2008 R2, Windows Storage Server 2008 R2

Remove-WindowsFeature

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

Note

This topic applies only to Windows Server 2008 R2. The Remove-WindowsFeature cmdlet has been replaced in Windows Server 2012 and forward by the Uninstall-WindowsFeature cmdlet. For more information about Uninstall-WindowsFeature in Windows Server 2012, see Uninstall-WindowsFeature. For more information about Uninstall-WindowsFeature in Windows Server 2012 R2, see Uninstall-WindowsFeature.

Syntax

Remove-WindowsFeature [-Name] <string[]> [-logPath <string>] [-WhatIf] [-Restart] [-Concurrent] [<CommonParameters>]
  • Name

  • logPath

  • WhatIf

  • Restart

  • Concurrent

Detailed Description

The Remove-WindowsFeature cmdlet allows you to remove specified roles, role services, and features from a computer that is running Windows Server 2008 R2. The Remove-WindowsFeature cmdlet functions similarly to the Remove Roles Wizard and Remove Features Wizard that you can start from the Server Manager UI. As in those wizards, you can remove more than one role, role service, or feature per session. 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 remove by using the Remove-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.

Default Value:

Data Type:

Attributes

Name Value PSMAML Attribute

Required?

true

required

Variable Length?

variableLength

Accept wildcard characters?

false

globbing

Accept Pipeline Input?

true (ByValue)

pipelineInput

Position?

1

position

Value Attributes

Name Value PSMAML Attribute

Required?

true

required

Variable Length?

variableLength

logPath

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

Default Value:

Data Type:

Attributes

Name Value PSMAML Attribute

Required?

false

required

Variable Length?

variableLength

Accept wildcard characters?

false

globbing

Accept Pipeline Input?

false

pipelineInput

Position?

named

position

Value Attributes

Name Value PSMAML Attribute

Required?

true

required

Variable Length?

variableLength

WhatIf

Displays any operations that are specified for the Remove-WindowsFeature cmdlet; displays the names of all roles, role services, or features that are removed.

Default Value:

Data Type:

Attributes

Name Value PSMAML Attribute

Required?

false

required

Variable Length?

variableLength

Accept wildcard characters?

false

globbing

Accept Pipeline Input?

false

pipelineInput

Position?

named

position

Value Attributes

Name Value PSMAML Attribute

Required?

required

Variable Length?

variableLength

Restart

Restarts the computer automatically when removal is complete, if restarting is required by the roles or features that were removed.

Default Value:

Data Type:

Attributes

Name Value PSMAML Attribute

Required?

false

required

Variable Length?

variableLength

Accept wildcard characters?

false

globbing

Accept Pipeline Input?

false

pipelineInput

Position?

named

position

Value Attributes

Name Value PSMAML Attribute

Required?

required

Variable Length?

variableLength

Concurrent

Allows concurrent instances of the Server Manager Add-WindowsFeature or Remove-WindowsFeature cmdlets to be running at the same time.

Default Value:

Data Type:

Attributes

Name Value PSMAML Attribute

Required?

false

required

Variable Length?

variableLength

Accept wildcard characters?

false

globbing

Accept Pipeline Input?

false

pipelineInput

Position?

named

position

Value Attributes

Name Value PSMAML Attribute

Required?

required

Variable Length?

variableLength

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 removed in a single session.

Examples

-------- Example 1 ----------

Command Prompt:

Remove-WindowsFeature Telnet-Server,Telnet-Client

Remove both Telnet Server and Telnet Client.

-------- Example 2 ----------

Command Prompt:

Get-WindowsFeature Web-* | Remove-WindowsFeature

Remove all Web features and any other Windows feature(s) that depend on them.

See Also

Reference

Get-WindowsFeature