Windows PowerShell: Importing modules and adding Roles and features
Importing roles and features on a windows server has never been easier.
Lot's of people prefer the GUI interface but PowerShell makes your life so much easier.
Firstly, for PowerShell to understand what you are trying to do, you need to have the correct module in place. In this instance we are working with Server Manager so we need to import that module and you can do so by running the following command in PowerShell:
- Import-Module ServerManager
Now that PowerShell knows we will be working with ServerManager, we can now add in the windows features, in this example it is for an Exchange Server:
- Add-WindowsFeature NET-Framework-Features,RSAT-Clustering,WAS-Process-Model,Web-Basic-Auth,Web-Lgcy-Mgmt-Console,Web-Metabase,Web-Mgmt-Console,Web-Net-Ext,Web-Server,Web-Windows-Auth -Restart
Once all is done you can reboot the server.