Install Windows roles and features with PowerShell

Installing Windows roles or features on a Windows Server 2008 R2, 2012 R2 or Windows Server 2016 is not too difficult. You can do this very easily with a few clicks of the mouse using Windows Server Manager . Today we would like to show you how you can install additional Windows roles or features using the PowerShell command.

It is important that you start a PowerShell console with administrator rights . Then the following PowerShell command must be issued.

Install-WindowsFeature FEATURENAME

Install Windows Feature with PowerShell

For example, if you want to install Windows Print Services using the PowerShell command, the command is

Install Windows Feature Print Services

After issuing the PowerShell command, the desired Windows feature is then installed . Here you can see the PowerShell installation window.

Start PowerShell installation

The installation process takes only a few seconds. After the installation you will see a message that the desired feature has been successfully installed on the Windows server. In the ” Restart ” column you can see whether the installed feature requires a Windows restart or not. In this case, the server does not have to be restarted.

If you  want to get an overview of all installed Windows features of a Windows server, then you have to use the following PowerShell command.

Get-WindowsFeature | where installed -eq true

In the following figure you can see which Windows features are all installed on the Windows Server 2012 R2 system. These include the ” Print and Document Services ” just installed .

Get-WindowsFeature where installed -eq true

This makes it very easy to install missing Windows features using the PowerShell command “Install-WindowsFeature” . In a further post we will then go into more detail on the possibility of how you can also remove Windows features using PowerShell . If you are interested in other useful PowerShell commands, please take a closer look at the following articles.

Read out computer system information with PowerShell – Prepare the Windows client for remote PowerShell commands with WINRM – Edit
local users and groups with
– Determine Windows system runtime with PowerShell – Create Windows 10 system restore point with PowerShell
– Shut down Windows and restart with PowerShell commands
– Repair Windows component stores with DISM and PowerShell commands
– Switch off UAC (user account control ) via PowerShell or registry in Windows 10
– PowerShell command to deactivate the firewall