Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Short of running dism /online /disbale-feature /remove /featurename:featurename on every feature I'd like to prune, is there a way of removing the payload on disk for every disabled feature?

share|improve this question
I was going to suggest a bit of PowerShell, but Get-WindowsFeature doesn't seem to work on Windows 8... – Michael Hampton Feb 25 '13 at 21:31
up vote 7 down vote accepted

Powershell 3.0 in Windows 8 provides a new cmdlet named Get-WindowsOptionalFeature which can be used to query features and their current state. With a little filtering you can pass this along the chain and execute dism for each feature.

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

Additional Links

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.