在 Windows 10 中,您可以在控制面板中“打开和关闭 Windows 功能” ;您会看到这样的屏幕:
假设我想通过在 powershell 中使用命令来选择IIS 6 WMI 兼容性。Enable-WindowsOptionalFeature
如果我运行:
Get-WindowsOptionalFeature "IIS 6 WMI Compatibility"
我收到此错误:
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
问题
如何将这些功能的名称映射到 PowerShell 命令?
最终目标
最终目标是自动设置新的开发人员和他的机器。