Easy IIS Feature Installation

Hello Everyone,

This is one of the most scripts used in organizations in order to install Internet Information Services ( IIS ) features .

Is this lesson we’re gonna learn about PowerShell variables which we indicate with Dollar Sign $. With defining your own variable after Dollar Sign you can easily call it from your script.

$IISfeature = “web-server”,”web-asp-net”,”web-asp-net45″,”web-net-ext”,”web-net-ext45″,”net-http-activation”,”web-common-http”,”web-default-doc”,”web-dir-browsing”,”web-static-content”,”web-http-redirect”,”web-dav-publishing”,”web-http-logging”,”web-health”,”web-custom-logging”,”web-request-monitor”,”web-http-tracing”,”web-performance”,”web-stat-compression”,”web-dyn-compression”,”web-security”,”web-filtering”,”web-basic-auth”,”web-ip-security”,”web-windows-auth”,”web-app-dev”,”web-asp”,”Web-cgi”,”web-isapi-ext”,”web-isapi-filter”,”web-includes”,”web-ftp-server”,”web-ftp-service”,”web-ftp-ext”,”web-mgmt-tools”,”web-mgmt-console”,”web-mgmt-compat”,”web-metabase”,”web-lgcy-mgmt-console”,”web-lgcy-scripting”,”web-wmi”,”web-scripting-tools”
install-windowsfeature -name $IISfeature
Enable-WindowsOptionalFeature -Online -FeatureName WCF-TCP-Activation45
Enable-WindowsOptionalFeature -Online -FeatureName WCF-HTTP-Activation45
Enable-WindowsOptionalFeature -Online -FeatureName WCF-TCP-PortSharing45
Enable-WindowsOptionalFeature -Online -FeatureName IIS-HttpErrors
Enable-WindowsOptionalFeature -Online -FeatureName IIS-LoggingLibraries
Enable-WindowsOptionalFeature -Online -FeatureName IIS-ApplicationInit

You may also like