Created
August 22, 2015 12:03
-
-
Save aplocher/7a559c3de6f480e4f6f4 to your computer and use it in GitHub Desktop.
Small PowerShell script that looks at the currently installed Windows Features on the current system and generates a dism.exe/ cmd.exe command to be used to restore those features. Handy for when you're reinstalling Windows on a machine and want to backup / restore your IIS, Hyper-V, etc configuration.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$o=$nothing | |
Get-WindowsOptionalFeature -Online | where State -eq Enabled | %{$o += ("/FeatureName:"+$_.FeatureName+" ")} | |
Write-Host "dism.exe /Online /Enable-Feature $o/All" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment