Install powershell v2 on server core r2
-
Wednesday, August 26, 2009 7:04 AMHi, does anyone know why powershell v2 cannot be installed with ocsetup anymore on server core r2.
I ran the command sucessfully but when I ran oclist again, it shows MicrosoftWindowsPoershell as not installed.
The only way to get it installed is using DSIM.
Cheers
Answers
-
Wednesday, August 26, 2009 8:07 AMModerator
Hi,
You can use OCSETUP to install PowerShell on Windows Server 2008 R2 Core edition. Because PowerShell runs based on .Net framework and the .Net Framework doesn’t installed in Windows Server 2008 R2 Core edition by default, so you should install NetFx2-ServerCore firs. You can 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: DISM is new tool in Windows Server 2008 R2. If you use "DISM /Online /Enable-Feature /FeatureName: MicrosoftWindowsPowerShell" to enable PowerShell before you enable "NetFx2-ServerCore", it will show you an error, but "start /w ocsetup" will never.
In addition, you can use the following command to install PowerShell cmdlet in Windows Server 2008 R2 Core edition.
-------------------
DISM /online /enable-feature /featurename=ServerManager-PSH-Cmdlets
DISM /online /enable-feature /featurename=BestPractices-PSH-Cmdlets
Vincent Hu
- Marked As Answer by Vincent HuMicrosoft Contingent Staff, Moderator Monday, August 31, 2009 8:17 AM
-
Wednesday, August 26, 2009 10:06 AMModerator
Hi,
I don't think the DSIM is the only way to install PowerShell on Windows Server 2008 R2 Core Edition. I just perform the test on my Windows Server 2008 R2 Core edition as the following and it works properly.1. Enables the NetFx2-ServerCore feature: start /w ocsetup NetFx2-ServerCore
2. Enables the PowerShell feature: start /w ocsetup MicrosoftWindowsPowerShell
Vincent Hu
- Proposed As Answer by Marco ShawMVP, Moderator Thursday, August 27, 2009 12:57 AM
- Marked As Answer by Vincent HuMicrosoft Contingent Staff, Moderator Monday, August 31, 2009 8:17 AM
All Replies
-
Wednesday, August 26, 2009 8:07 AMModerator
Hi,
You can use OCSETUP to install PowerShell on Windows Server 2008 R2 Core edition. Because PowerShell runs based on .Net framework and the .Net Framework doesn’t installed in Windows Server 2008 R2 Core edition by default, so you should install NetFx2-ServerCore firs. You can 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: DISM is new tool in Windows Server 2008 R2. If you use "DISM /Online /Enable-Feature /FeatureName: MicrosoftWindowsPowerShell" to enable PowerShell before you enable "NetFx2-ServerCore", it will show you an error, but "start /w ocsetup" will never.
In addition, you can use the following command to install PowerShell cmdlet in Windows Server 2008 R2 Core edition.
-------------------
DISM /online /enable-feature /featurename=ServerManager-PSH-Cmdlets
DISM /online /enable-feature /featurename=BestPractices-PSH-Cmdlets
Vincent Hu
- Marked As Answer by Vincent HuMicrosoft Contingent Staff, Moderator Monday, August 31, 2009 8:17 AM
-
Wednesday, August 26, 2009 9:11 AMThank you.
As mentioned in my post, I was able to use DSIM to install powershell v2 on server core R2.
But with ocsetup, it ran without error but still powershell was not install.
So my question: Is DSIM the only way to install powershell on servercore? If so why is ocsetup support removed??
Cheers -
Wednesday, August 26, 2009 10:06 AMModerator
Hi,
I don't think the DSIM is the only way to install PowerShell on Windows Server 2008 R2 Core Edition. I just perform the test on my Windows Server 2008 R2 Core edition as the following and it works properly.1. Enables the NetFx2-ServerCore feature: start /w ocsetup NetFx2-ServerCore
2. Enables the PowerShell feature: start /w ocsetup MicrosoftWindowsPowerShell
Vincent Hu
- Proposed As Answer by Marco ShawMVP, Moderator Thursday, August 27, 2009 12:57 AM
- Marked As Answer by Vincent HuMicrosoft Contingent Staff, Moderator Monday, August 31, 2009 8:17 AM
-
Friday, August 28, 2009 7:59 AMModerator
· Hi,
Have you tried the suggestion? I want to see if the information provided was helpful. Your feedback is very useful for the further research. Please feel free to let me know if you have addition questions.
Best regards,
Vincent Hu
-
Monday, August 31, 2009 6:52 AMHi, if i run ocsetup NetFx2-ServerCore first follow by ocsetup MicrosoftWindowsPowershell, Powershell v2 install sucessfully.
But if I run ocsetup MicrosoftWindowsPowershell first without the .net framework, it appears to work but if you run oclist, powershell is not installed. A little bit of inconsistency here. -
Monday, August 31, 2009 7:00 AMModerator
Hi,
As I mentioned in my first reply, PowerShell runs based on .Net Framework, so PowerShell cannot be installed until you install .Net Framework.
Vincent Hu
-
Monday, August 31, 2009 7:02 AM
Hi,
As I mentioned in my first reply, PowerShell runs based on .Net Framework, so PowerShell cannot be installed until you install .Net Framework.
Vincent Hu
Yes I know that, but don't you think ocsetup needs to prompt the user that a pre-req is missing instead of just silently "suceed". -
Monday, August 31, 2009 7:08 AMModerator
Hi,
OCSETUP is an “old” tool and not “intelligent” enough, so I recommend that you use DISM instead of it. If you are using DISM, you will see the installation process in percent and it will give you the exactly error is the installation is not complete properly.
Vincent Hu
-
Monday, August 31, 2009 7:29 AM
Hi,
OCSETUP is an “old” tool and not “intelligent” enough, so I recommend that you use DISM instead of it. If you are using DISM, you will see the installation process in percent and it will give you the exactly error is the installation is not complete properly.
Vincent Hu
From this link http://technet.microsoft.com/en-us/library/dd799247(WS.10).aspx
""The Windows® Optional Component Setup (OCSetup.exe) tool is a command-line tool that can be used to add system components to an online Windows image. It installs or removes Component-Based Servicing (CBS) packages online by passing packages to the Deployment Image Servicing and Management (DISM) tool for installation or removal. OCSetup can also be used to install Microsoft® System Installer (MSI) packages by calling the Windows Installer service (MSIExec.exe) and passing Windows Installer components to it for installation or removal. In addition, OCSetup can be used to install CBS or MSI system component packages that have associated custom installers (.exe files). The OCSetup tool is available as part of the Windows® 7 and Windows Server® 2008 R2 operating systems.
You can use OCSetup.exe on a computer running Windows 7 or Windows Server 2008 R2."
Ocsetup certainly doesn't look to be an old tool to me since it works with DISM. So I expect the same behaviour regardless of using DISM or ocsetup. -
Monday, August 31, 2009 7:44 AMModerator
Hi,
The “old” I said is compared to DISM. DISM is more intelligent for daily work and our product group is planning to remove ocsetup in the further.
Vincent Hu