Windows

從 Windows 8 中批量刪除 Features On Demand 負載?

  • September 15, 2016

dism /online /disable-feature /remove /featurename:featurename在我想修剪的每個功能上都沒有執行,有沒有辦法為所有禁用的功能刪除磁碟上的有效負載?

Windows 8 中的 Powershell 3.0 提供了一個名為Get-WindowsOptionalFeature的新 cmdlet ,可用於查詢功能及其目前狀態。通過一點過濾,您可以將其沿鏈傳遞並為每個功能執行 dism。

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

附加連結

引用自:https://serverfault.com/questions/482345