从Windows 8批量删除function按需有效载荷?

dism /online /disable-feature /remove /featurename:featurename运行dism /online /disable-feature /remove /featurename:featurename我想修剪的每个function,是否有删除所有禁用function的磁盘有效载荷的方法?

Windows 8中的Powershell 3.0提供了一个名为Get-WindowsOptionalFeature的新cmdlet,可用于查询要素及其当前状态。 通过一些过滤,你可以通过这个链,并执行dism每个function。

 Get-WindowsOptionalFeature -Online | where { $_.State -match "Disabled" } | ` foreach { ` $_ = $_.FeatureName; ` DISM /Online /Disable-Feature /FeatureName:$_ /Remove ` } 

其他链接

  • 启用或禁用使用DISM的Windowsfunction
  • 使用PowerShell在Windows 8中查找禁用的function
  • 使用DISM从命令行pipe理Windowsfunction