Useful Windows Feature Commands

There are a number of cmdlets from the ServerManager module that I find myself using on a regular basis, specifically WindowsFeature cmdlets.

I thought I'd share some of them. This one shows what PowerShell related stuff I have installed or available...

Get-WindowsFeature | Where-Object {$_.DisplayName -like "*PowerShell*"} | Format-Table -AutoSize -Wrap

For example:

 

This >= PS v3 variation shows Active Directory stuff (you get the idea)...

Get-WindowsFeature | Where DisplayName -like "*Active*" | Format-Table -AutoSize -Wrap

For example:

 

This one adds the Group Policy Management Console...

Add-WindowsFeature "GPMC"

For example:

 

This one adds the Integrated Scripting Environment...

Add-WindowsFeature "PowerShell-ISE"

 

This one adds the AD Management tools...

Add-WindowsFeature "RSAT-AD-Tools"

 

And this one adds the AD PowerShell module...

Add-WindowsFeature "RSAT-AD-PowerShell" 

 

Finally, not one I use that often, but you can use this one in Windows Server 2012 to switch from server GUI to server Core...

Uninstall-WindowsFeature "Server-Gui-Shell" -Restart

 

And then back again...

Add-WindowsFeature "Server-Gui-Shell" -Restart

 

Incidentally, the Uninstall-WindowsFeature cmdlet replaces the Remove-WindowsFeature cmdlet that we know (and love) from Windows Server 2008 R2. One difference is that the Uninstall cmdlet will preserve admin tools (unless you tell it not to). Another difference is that it can target a VHD.

 

This has been a 2014 PoSh Chap Production featuring the WindowsFeature feature.