Managing Windows Features (Part 2)

by Aug 15, 2018

In Windows 10, unlike in Windows Server, you cannot use the Get-WindowsFeature and Add-WindowsFeature cmdlets to manage Windows features.

However, for clients there is a very similar cmdlet available: Enable-WindowsOptionalFeature. These lines would add the PowerShell Hyper-V cmdlets and the Hyper-V features:

Enable-WindowsOptionalFeature -Online -All -FeatureName Microsoft-Hyper-V-Management-PowerShell -NoRestart
Enable-WindowsOptionalFeature -Online -All -FeatureName Microsoft-Hyper-V -NoRestart

The result is an object telling you whether a restart is required or not.

Note the –All parameter: if you omit this parameter, then it is your responsibility to ensure that all prerequisites and dependent features are installed before you add another one. If you are lazy, or do not know the dependencies, then –All will also add all required dependent features for you.

Twitter This Tip! ReTweet this Tip!