It is very simple...
Install-WindowsFeature -Name AD-Domain-Services, DNS -IncludeManagementTools -OutVariable result -Verbose Get-WindowsFeature -Name $result.FeatureResult.Name
Note: GUIs are not recommended for the server. Install only AD-Domain-Services, DNS and RSAT-AD-PowerShell on your Windows Server Core and RSAT on your management server.
Display Name Name Install State ------------ ---- ------------- [X] Active Directory Domain Services AD-Domain-Services Installed [X] DNS Server DNS Installed [X] Group Policy Management GPMC Installed [X] Remote Server Administration Tools RSAT Installed [X] Role Administration Tools RSAT-Role-Tools Installed [X] AD DS and AD LDS Tools RSAT-AD-Tools Installed [X] Active Directory module for Windows ... RSAT-AD-PowerShell Installed [X] AD DS Tools RSAT-ADDS Installed [X] Active Directory Administrative ... RSAT-AD-AdminCenter Installed [X] AD DS Snap-Ins and Command-Line ... RSAT-ADDS-Tools Installed [X] DNS Server Tools RSAT-DNS-Server Installed« Previous Next »