Enable script in powershelgl:

set-executionPolicy RemoteSigned

Create a ps script file: install.ps1

install-windowsFeature -Name AD-Domain-Services
if(Test-ADDSForestInstallation -DomainName "mcc.edu" -DomainNetbiosName "mcc" -Force)
 { Import-Module ADDSDeployment
 Install-ADDSForest `
 -CreateDnsDelegation:$false `
 -DatabasePath "C:\Windows\NTDS" `
 -DomainMode "Win2012R2" `
 -DomainName "MCC.edu" `
 -DomainNetbiosName "MCC" `
 -ForestMode "Win2012R2" `
 -InstallDns:$true `
 -LogPath "C:\Windows\NTDS" `
 -NoRebootOnCompletion:$false `
 -SysvolPath "C:\Windows\SYSVOL" `
 -Force:$true
 }
End If