Tests if an optional Windows component is installed.
Test-WindowsFeature [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
The names of the features are different on different versions of Windows. You can get a list by running the following commands.
On Windows 2008:
serveramanagercmd.exe -q
One Windows 7:
Get-WmiObject -Class Win32_OptionalFeature | Select-Object Name
Name | Type | Description | Required? | Pipeline Input | Default Value |
---|---|---|---|---|---|
Name | String | The name of the feature to test. Feature names are case-sensitive and are different between different versions of Windows. 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 . |
Test-WindowsFeature -Name MSMQ-Server
Tests if MSMQ is installed.
Test-WindowsFeature -Name IIS-WebServer
Tests if IIS is installed on Windows 7.
Test-WindowsFeature -Name Web-WebServer
Tests if IIS is installed on Windows Server 2008.