Ability to add or remove multiple features to list of computers

Oct 1, 2015 at 11:15 AM
It doesn't seem like you can remove multiple features at one time, something like Remove-ClientFeature -Name Printing-XPSServices-Features,MediaCenter -Force would be useful. Also you can't add -computername server01 so you can't run against multiple computers. The process does work great for adding or removing one feature at a time. Would it be difficult to make these changes?
Oct 1, 2015 at 12:23 PM
I found a quick low down and dirty way of doing this:
$computers = Get-Content -path c:\computerlist.txt
foreach ($computer in $computers)
{
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:FaxServicesClientPackage /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:MediaCenter /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:MediaPlayback /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:OpticalMediaDisc /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:Printing-Foundation-InternetPrinting-Client /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:Printing-XPSServices-Features /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:WindowsGadgetPlatform /NoRestart}
        Invoke-Command -computername $Computer {Dism /online /Disable-Feature /FeatureName:Xps-Foundation-Xps-Viewer /NoRestart}
}