Created
March 30, 2017 10:26
-
-
Save Dan1el42/acc7fea5eb1e07a22ab8e670183fc5b2 to your computer and use it in GitHub Desktop.
Translate DISM feature names into PowerShell compatible ones.
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
# Translate DISM feature names to PowerShell | |
$translationTable = @' | |
NetFx4ServerFeatures | |
NetFx4 | |
NetFx4Extended-ASPNET45 | |
IIS-WebServerRole | |
IIS-WebServer | |
IIS-CommonHttpFeatures | |
IIS-Security | |
IIS-RequestFiltering | |
IIS-StaticContent | |
IIS-DefaultDocument | |
IIS-DirectoryBrowsing | |
IIS-HttpErrors | |
IIS-HttpRedirect | |
IIS-WebDAV | |
IIS-HealthAndDiagnostics | |
IIS-HttpLogging | |
IIS-Performance | |
IIS-HttpCompressionStatic | |
IIS-WebServerManagementTools | |
IIS-ManagementConsole | |
IIS-LoggingLibraries | |
IIS-RequestMonitor | |
IIS-CustomLogging | |
IIS-ODBCLogging | |
'@ -split "`n" | | |
ForEach-Object { | |
$feature = Get-WindowsOptionalFeature -Online -FeatureName ($_.Trim()) | |
[PSCustomObject] @{ | |
DismFeatureName = $feature.FeatureName | |
PowerShellFeatureName = $feature.CustomProperties | | |
Where-Object { $_.Name -eq 'UniqueName' -and $_.Path -eq 'ServerComponent' } | | |
Select-Object -ExpandProperty Value | |
} | |
} | |
# Output whole translation table | |
#$translationTable | |
# Only output the PowerShell feature names | |
$translationTable.PowerShellFeatureName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment