Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.