PowerShell Add-WindowsFeature

I always try to remember the PowerShell command for installing Roles and Features in Windows 2008 R2 Server, but I always easily forget. 

What I always know is the Import-Module ServerManager.

If you want to do installing features using PowerShell for fastest installation, use Get-WindowsFeature. It will help you to use the short name.

For example:

1. Open PowerShell and typing Import-Module ServerManager

2. Then, type Get-WindowsFeature and the result looks like below:
     

3. The [X] on the left hand side, means that the service is already installed in your system.

4. To install some of the features, let'say "XPS Viewer", you need to use Add-WindowsFeature followed with the Name. 

           For Example, type Add-WindowsFeature -XPS-Viewer

5. After hitting the command above, the result will be shown whether the features successfully installed or not.
The status looks like below

                  
                   
PowerShell Code - Summary

Import-Module ServerManager -Verbose
Get-WindowsFeature
help Add-WindowsFeature

See Also