Uninstalls optional Windows components/features.
Uninstall-WindowsFeatures [-Features] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]
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.
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 . |
Uninstall-WindowsFeatures -Features MSMQ-Server
Uninstalls MSMQ.
Uninstall-WindowsFeatures -Features IIS-WebServer
Uninstalls IIS on Windows 7.
Uninstall-WindowsFeatures -Features Web-WebServer
Uninstalls IIS on Windows 2008.