Recently I had to prep Windows Server 2008 R2 for a new exchange install so I thought I would look into the PowerShell functionality and see what things they are doing. One issue that I have always had with Windows is that they lack a repo style way of installing packages. I like Linux distros way of doing this. In Linux from a shell I know I can just apt-get install {package} or yum install {package}. It is straight forward.
So when I found that I could import the server manager module in the power shell I thought this was great. I Just open powershell
> import-module servermanager
> add-windowsfeature web-server
Thats it. You can also run get-windowsfeature web-server and see that it has been installed. So to prep the install I ran the following commands:
Add-WindowsFeature Web-Server
Add-WindowsFeature Web-ISAPI-Ext
Add-WindowsFeature Web-Metabase
Add-WindowsFeature Web-Lgcy-Mgmt-Console
Add-WindowsFeature Web-Basic-Auth
Add-WindowsFeature Web-Digest-Auth
Add-WindowsFeature Web-Windows-Auth
Add-WindowsFeature Web-Dyn-Compression
(Note ensure that you have IIS management console and scripts & tools role services installed before installing exchange)
After a few status bars I was ready to go. You can also use wild cards: get-windowsfeature web-*

