none
64bit Powershell In VMM Console

    Question

  • It looks like running powershell from the VMM Console, either by running a specific script in the library or clicking the PowerShell icon in the Console, runs the 32bit version of Powershell.  I need the 64bit version of it for a script that uses a parallel workflow to migrate multiple VM's at once. 

    It would be great to store this in the library and run it right from the console if needed.  Is this possible or am I just going to have to run it outside the console?  Also, why the heck can't I just select multiple VM's in the console and live migrate them?  Giving 2012 the ability to do simultaneous live migrations is awesome, but why limit the console to having to start them one at a time?  Powershell is great, but it's a little annoying that it's the only 'real' way to do it, especially if it can't be done from the powershell environment in the VMM console.  Or am I going about it all wrong?

    Thursday, July 18, 2013 11:54 PM

All replies

  • We've managed to get around this by creating a new PSSession, connecting to it, and then running the script.  On a windows 2012 server modify your script as follows:

    $session = new-pssession -ConfigurationName windows.powershell

    Enter-PSSession $session

    <your script here>

    Exit-PSSession

    Remove PSSession $session

    -Dave

    Friday, July 19, 2013 2:42 PM
  • Ok... I lied....  This only works from the command line....

    This, however, does work

    $session = new-pssession -ConfigurationName windows.powershell

    Invoke-Command -session $session -ScriptBlock {

    <your script here>

    }

    Remove PSSession $session

    We have run into some issues with some commands (so far mostly failovecluster) where CredSSP would need to be enabled to get around UAC issues.

    -Dave

    Friday, July 19, 2013 3:12 PM
  • Thanks for the correction, was just starting to wonder what I was doing wrong.  But what I've realized now is that I'm using out-gridview to get a nice listing of VM's to select for migration, which doesn't work in a remote session.  Is there a way to start a new session that isn't considered a remote one?  Even if I do:

    $session=new-pssession-ComputerNamelocalhost

    It seems to still consider it a remote session, which I guess makes sense.

    Friday, July 19, 2013 4:00 PM