Add or remove roles and features in Windows Server — by Microsoft Learn
Official walkthrough for installing and removing server roles and features with the Server Manager wizard or PowerShell, on a local server, a remote server or an offline VHD. It also shows how to export the wizard choices to an XML file so the same roles can be pushed to several servers.