Install PowerShell on Windows Server 2008 R2 Core

Posted by Mike
Nov 18 2009

Today I installed Windows Server 2008 R2 Standard Core, expecting to be presented with PowerShell. Wrong. I was presented with good old cmd.exe. It took me a while to find this information, so I thought I'd blog it here. To install PowerShell, you need to run the following commands:


DISM /Online /Enable-Feature /FeatureName:NetFx2–ServerCore
DISM /Online /Enable-Feature /FeatureName:MicrosoftWindowsPowerShell

Now you can launch powershell.exe from C:\Windows\System32\WindowsPowerShell\v1.0. Although the path would suggest PowerShell 1.0, a quick Get-Host indicates PowerShell 2.0:

Get-Host output

Get-Host output

A little more about DISM, for those that are interested. DISM is the "Deployment Image Servicing and Management tool" and can be used to perform various configuration tasks on offline or running images. Hence the /Online switch is used to tell DISM it must target the running operating system. The following command will list all features and their status (suggest you pipe it through more):


DISM /Online /Get-Features | more

Note that PowerShell requires .NET Framework 2.0, hence the first DISM command.

Thanks to Vincent Hu for his post on TechNet, which I finally found. There is a slight mistake, though, as there should be no space between /FeatureName: and the feature you want to install.

Trackback URL for this entry