Test-WindowsFeature

Tests if an optional Windows component is installed.

Syntax

Test-WindowsFeature [-Name] <String> [-WhatIf] [-Confirm] [<CommonParameters>]

Description

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

Parameters

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.

EXAMPLE 1

Test-WindowsFeature -Name MSMQ-Server

Tests if MSMQ is installed.

EXAMPLE 2

Test-WindowsFeature -Name IIS-WebServer

Tests if IIS is installed on Windows 7.

EXAMPLE 3

Test-WindowsFeature -Name Web-WebServer

Tests if IIS is installed on Windows Server 2008.