如果我想修剪的每个功能都没有运行dism / online / disable-feature / remove / featurename:featurename,是否有办法删除所有禁用功能的磁盘上的负载?
Windows 8中的Powershell 3.0提供了一个名为
Get-WindowsOptionalFeature的新cmdlet,可用于查询功能及其当前状态.通过一点过滤,您可以沿着链传递它并为每个功能执行dism.
原文链接:https://www.f2er.com/windows/366659.htmlGet-WindowsOptionalFeature -Online | where { $_.State -match "Disabled" } | ` foreach { ` $_ = $_.FeatureName; ` DISM /Online /Disable-Feature /FeatureName:$_ /Remove ` }
其他链接
> Enable or Disable Windows Features Using DISM
> Use PowerShell to Find Disabled Features in Windows 8
> Manage Windows Features from Command Line with DISM