How to install PowerShell on Windows Server 2012 R2 Core

PoweShell is not installed by default on Windows Core edition. We need to enable the feature. One of the prerequisite for PowerShell is .Net Framework. We need to install .Net framework first:

Command to install .Net Framework 4.0

Dism /Online /Enable-Feature /FeatureName:NetFx4 /All
Dism /Online /Enable-Feature /FeatureName:NetFx4 /All /LimitAccess /Source:X:\sources\sxs

Command to install PowerShell

Dism /Online /Enable-Feature /FeatureName:MicrosoftWindowsPowerShell /All