none
Installing PowerShell on Hyper-V Server 2008 R2 RC

    Question

  • I've got Hyper-V Server 2008 R2 RC running here and I'm trying to set up PowerShell for local server administration (I know I should manage it remotely but this is a developer workstation setup specifically to avoid multiple machines).

    I followed Ben Armstrong's advice to install PowerShell (http://blogs.msdn.com/virtual_pc_guy/archive/2009/02/10/enabling-powershell-on-hyper-v-server-2008-r2.aspx) and there was no error message but there doesn't seem to be a C:\Windows\system32\WindowsPowerShell folder to launch the shell.

    I'm wondering if it's me just having a bad day or is it really missing in the RC?

    Mark

    Mark Wilson (MVP Virtual Machine) - http://www.markwilson.co.uk/blog/
    Thursday, August 6, 2009 4:16 PM

Answers

  • Hi,

     

    Based on my research, you should install NetFx2-ServerCore first, because PowerShell runs based on .Netframawork. 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.
     

    Best Regards,

    Vincent Hu

     

    Friday, August 7, 2009 9:05 AM
    Moderator

All replies

  • Hi,

     

    Based on my research, you should install NetFx2-ServerCore first, because PowerShell runs based on .Netframawork. 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.
     

    Best Regards,

    Vincent Hu

     

    Friday, August 7, 2009 9:05 AM
    Moderator
  • Thanks for this Vincent - I'll check it out and let you know how I get on.

    (It's a bit embarrassing that a virtualisation MVP can't get this working!)

    Mark Wilson (MVP Virtual Machine) - http://www.markwilson.co.uk/blog/
    Friday, August 7, 2009 4:53 PM
  • Unfortunately the .net framework installation (step 2) fails with error 3017.  Looking at the DISM logs it seems that it doesn't like the featurename.

    2009-08-07 22:45:55, Info                  DISM   DISM Package Manager: PID=1712 Encountered the option "featurename" with value "NetFx2-ServerCore" - CPackageManagerCLIHandler::Private_GetPackagesFromCommandLine
    2009-08-07 22:45:55, Info                  DISM   DISM Package Manager: PID=1712 Encountered an unknown option "featurename" with value "NetFx2-ServerCore" - CPackageManagerCLIHandler::Private_GetPackagesFromCommandLine

    Does anyone have an idea what might be the problem here :-(

    TIA, Mark
    Mark Wilson (MVP Virtual Machine) - http://www.markwilson.co.uk/blog/
    Friday, August 7, 2009 10:53 PM
  • Hi, I succeed. please run DISM /Online /Get-Features and then look for the NetFx2-ServerCore in the output list to check whether you have type the correct word.
    Saturday, August 8, 2009 3:45 AM
  • Yes, it's there in Get-Features and as you can see from the error, I typed it correctly in the Enable-Feature.  Bizarre!
    "TT630" wrote in message news:17b7992c-7bbc-420 a-b3a6-8c4df4ff5475...
    Hi, I succeed. please run DISM /Online /Get-Features and then look for the NetFx2-ServerCore in the output list to check whether you have type the correct word.
    Saturday, August 8, 2009 9:33 AM
  • Hi,

     

    How is your states now? I perform the command for several times on my local Hyper-V Server 2008 R2 RC computer without any errors. I suspect there are some wrong character when you input.

     

    I recommend that you perform the following steps:

     

    1.    Type “DISM /Online /Get-Features” in an elevated command prompt line.

    2.    Find feature name “NetFx2-ServerCore” in the output list.

    3.    Type “DISM /Online /Enable-Feature /FeatureName:NetFx2-ServerCore”.

    Note: You may copy the above command to the notepad and then copy it and paste into the command line.

     

     

    Best Regards,

    Vincent Hu

     

    Monday, August 10, 2009 9:42 AM
    Moderator
  • ·         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

    Wednesday, August 12, 2009 2:06 PM
    Moderator
  • Hi Vincent, I'm still not able to get this working on my build; however with RTM availability expected today I will rebuild on RTM code and see if that's any more successful. The only thing I can think that's different between mine and yours is that mine has previously attempted to install PowerShell using ocsetup (which obviously failed silently - possibly that's the issue). It's not a typing errpr - as you can see from the log extract I supplied, dism is complaining about the featurename, spelt correctly! The other possibility is that this is a complication when running from flash in a boot from VHD scenario (which is what I am doing). (Slightly disappointed to see this marked as answered before I have this working... but have also been a moderator so understand that a slow response might lead to a question being marked as answered...) Thanks for your help with this - will report back when I have tried this with the RTM build: probably towards the end of next week.
    Mark Wilson (MVP Virtual Machine) - http://www.markwilson.co.uk/blog/
    Friday, August 14, 2009 11:54 AM
  • Hi,

     

    How is your status now? Have you installed Hyper-V Server 2008 R2 RTM and installed the PowerShell?

     

     

    Best Regards,

    Vincent Hu

     

    Monday, August 17, 2009 6:26 AM
    Moderator
  • Hi Vincent,
    Thanks for nudging this, but the RTM code was only made available on TechNet on Friday (evening) and it's now only Monday morning!  I hope to begin testing with RTM today but, as I said in my last post, it will probably be later this week when I report back.

    Regards, Mark

    Mark Wilson (MVP Virtual Machine) - http://www.markwilson.co.uk/blog/
    Monday, August 17, 2009 9:00 AM
  • Hi,

     

    Please take you time to do it.

     

     

    Best Regards,

    Vincent Hu

     

    Monday, August 17, 2009 9:34 AM
    Moderator
  • Hi Vincent,
    Thanks for all your help with this.  On a new VHD, using the RTM media, it worked as described, even if it took a while to load because of the slow flash drive...

    I can only assume that the problem on RC was due to the failed ocsetup or perhaps a timeout error as the commands used were identical.

    Anyway - thanks again for your assistance as this advice was hard to come by.  I can feel a new blog post coming on now...

    Cheers, Mark

    Mark Wilson (MVP Virtual Machine) - http://www.markwilson.co.uk/blog/
    Monday, August 17, 2009 9:05 PM
  • Hi,

     

    Glad to hear that you finally succeed.

     

     

    Best Regards,

    Vincent Hu

     

    Tuesday, August 18, 2009 9:47 AM
    Moderator
  • Got stuck on this too, and so wrote it up with step by step screen shots, just in case anyone finds it useful.

    http://geekswithblogs.net/twickers/archive/2009/11/04/136013.aspx
    Thursday, November 5, 2009 9:42 AM
  • Hi,

     

    How is your states now? I perform the command for several times on my local Hyper-V Server 2008 R2 RC computer without any errors. I suspect there are some wrong character when you input.

     

    I recommend that you perform the following steps:

     

    1.    Type “DISM /Online /Get-Features” in an elevated command prompt line.

    2.    Find feature name “NetFx2-ServerCore” in the output list.

    3.    Type “DISM /Online /Enable-Feature /FeatureName:NetFx2-ServerCore”.

    Note: You may copy the above command to the notepad and then copy it and paste into the command line.

     

     

    Best Regards,

    Vincent Hu

     

    And what if I see many features and don't see “NetFx2-ServerCore” in the output list?


    Best regards

    Friday, March 23, 2012 8:37 AM
  • Awesome, thank you. One little note: no space after "/FeatureName:".
    Saturday, June 8, 2013 7:54 PM
  • Got stuck on this too, and so wrote it up with step by step screen shots, just in case anyone finds it useful.

    http://geekswithblogs.net/twickers/archive/2009/11/04/136013.aspx
    Thank you, that helped a lot.
    Saturday, June 8, 2013 7:54 PM