Uninstall-WindowsFeatures

Uninstalls optional Windows components/features.

Syntax

Uninstall-WindowsFeatures [-Features] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Description

The names of the features are different on different versions of Windows. For a list, run the following commands:

On Windows 2008:

serveramanagercmd.exe -q

One Windows 7:

Get-WmiObject -Class Win32_OptionalFeature | Select-Object Name

Feature names are case-sensitive. If a feature is already uninstalled, nothing happens.

Parameters

Name Type Description Required? Pipeline Input Default Value
Features String[] The names of the components to uninstall/disable. Feature names are case-sensitive. The names are different between Windows versions. For a list, on Windows 2008, run serveramanagercmd.exe -q; on Windows 7, run Get-WmiObject -Class Win32_OptionalFeature | Select-Object Name. true false
WhatIf SwitchParameter false false
Confirm SwitchParameter false false
CommonParameters This cmdlet supports common parameters. For more information type
Get-Help about_CommonParameters.

EXAMPLE 1

Uninstall-WindowsFeatures -Features MSMQ-Server

Uninstalls MSMQ.

EXAMPLE 2

Uninstall-WindowsFeatures -Features IIS-WebServer

Uninstalls IIS on Windows 7.

EXAMPLE 3

Uninstall-WindowsFeatures -Features Web-WebServer

Uninstalls IIS on Windows 2008.