Question
PowerShell feature is a very useful management tool for system administrators, especially on Server Core server and Microsoft Hyper-V Server 2008 R2 which do not have UI. How can I install PowerShell feature on a Windows Server 2008 R2 Server Core server?
Answer
PowerShell feature depends on the NetFx2-ServerCore feature to be installed properly. To install the PowerShell feature, we need to first install NetFx2-ServerCore feature and then install MicrosoftWindowsPowerShell feature. To do so, please perform the following steps:
1. Use the following command to displays a list of features and their status:
DISM /Online /Get-Features
2. Enables the NetFx2-ServerCore feature:
DISM /Online /Enable-Feature /FeatureName: NetFx2-ServerCore
3. Enables the PowerShell feature:
DISM /Online /Enable-Feature /FeatureName: MicrosoftWindowsPowerShell
When you finish the above steps, you will be able to find the C:\Windows\system32\WindowsPowerShell folder and launch the shell.
Note: It is recommend that you use DISM to install the features instead of OCSETUP in Windows Server 2008 R2. DISM is a new tool in Windows Server 2008 R2 and is more intelligent than OCSETUP.
In addition, there are some other useful CMDLET you can use:
DISM /online /enable-feature /featurename=ServerManager-PSH-Cmdlets
DISM /online /enable-feature /featurename=BestPractices-PSH-Cmdlets
More Information
Microsoft® Hyper-V™ Server 2008 R2
http://www.microsoft.com/hyper-v-server/en/us/default.aspx
Windows PowerShell Getting Started Guide
http://msdn.microsoft.com/en-us/library/aa973757(VS.85).aspx
Applies to
Windows Server 2008 R2
Microsoft® Hyper-V™ Server 2008 R2