Partager via


Get-WindowsFeature

Get-WindowsFeature

Retrieves information about Windows Server roles, role services, and features that are available.

Syntax

Parameter Set: Default
Get-WindowsFeature [[-Name] <String[]> ] [-ComputerName <String> ] [-Credential <PSCredential> ] [-LogPath <String> ] [-Vhd <String> ] [ <CommonParameters>]

Detailed Description

The Get-WindowsFeature cmdlet retrieves information about roles, role services, and features that are available on a computer that is running Windows Server® “8” Beta or an offline virtual hard disk (VHD) that has Windows Server “8” Beta on it. This cmdlet displays the Windows features that are already installed on the computer and those that are available to install.

Parameters

-ComputerName<String>

Obtains the list of available role, role services and features from the specified remote computer. Accepts only one computer name. The default is the local computer.
The NetBIOS name, an IP address, or a fully qualified domain name of a remote computer can be specified. Note: The target computer should be running Windows Server “8” Beta.
To use an IP address in the value of this parameter, the cmdlet must include the Credential parameter. The computer must also be configured for HTTPS transport or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For instructions for adding a computer name to the WinRM TrustedHosts list, see How to Add a Computer to the Trusted Host List in about_Remote_Troubleshooting.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Credential<PSCredential>

Specifies a user account that has permission to perform this action. The default for this parameter is the current user.
Enter a user name in one of the following formats surrounded by quotes:
"UserName"
"Domain\User"
"User@Domain.com"
● A Credential object returned by the Get-Credential cmdlet.
If a user name is typed, then a prompt for a password will be displayed.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-LogPath<String>

Specifies a name and location for a log file. Add this parameter if the results of this cmdlet must be stored in a log.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<String[]>

Specifies the command IDs of roles, role services, or features about which to return information.

Aliases

none

Required?

false

Position?

1

Default Value

none

Accept Pipeline Input?

True (ByValue)

Accept Wildcard Characters?

true

-Vhd<String>

Specifies the path to an offline VHD. The path can point to a VHD file or to a location on which the VHD is already mounted using Deployment Image Servicing and Management (DISM) tools.
The VHD can be present on a local hard disk attached to the target computer or on a network share.
If the VHD is present on a network share, then specify the UNC path to the VHD. In this case, the computer account in which the VHD is mounted must have read and write permissions on the network share, otherwise the VHD cannot be accessed. Local loopback UNC paths are not supported. Use the following format for the computer account: DOMAIN\SERVERNAME$
Use the ComputerName parameter to specify the target computer to be used for mounting the VHD. If the ComputerName parameter is not specified, then the local computer is used. The computer on which the VHD is mounted must be running Windows Server “8” Beta. Any local path, such as D:\myFolder, specified with this parameter is always relative to the target computer.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.String[]

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Microsoft.Windows.ServerManager.Commands.Feature

Examples

EXAMPLE 1

This example returns a list of features available on the target computer named Server1.

PS C:\> Get-WindowsFeature -ComputerName Server1 -Credential contoso.com\johnj99

EXAMPLE 2

This example returns a list of features available on the specified VHD located at D:\ps-test\vhd1.vhd.

PS C:\> Get-WindowsFeature -Vhd D:\ps-test\vhd1.vhd

EXAMPLE 3

This example returns a list of features with command ID that starts with AD or Web.

PS C:\> Get-WindowsFeature -Name AD*, Web*

Install-WindowsFeature

Uninstall-WindowsFeature