In Windows 10, you can "Turn windows features on and off" in the control panel; you see a screen as such:
Let's say I want to select IIS 6 WMI Compatibility by using the Enable-WindowsOptionalFeature
command in powershell.
If I run :
Get-WindowsOptionalFeature "IIS 6 WMI Compatibility"
I get this error:
Get-WindowsOptionalFeature : A positional parameter cannot be found that accepts argument 'IIS 6 WMI Compatibility'.
At line:1 char:1
+ Get-WindowsOptionalFeature "IIS 6 WMI Compatibility"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Get-WindowsOptionalFeature], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.Dism.Commands.GetWindowsOptionalFeatureCommand
Question
How do I map the names of these features to the PowerShell command?
End Goal
The end goal is to automate setting up a new developer and his machine.
for
loop and just do that instead. I'll mark as accepted because that's more succinct than my answer. – Dragonet