Automation

 View Only
  • 1.  Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 12:42 PM

    Hi,

    I'm trying to use SSH to launch some powerCLI script that i need to run. I tried different ssh servers, and i have noticed that there are some differences that i cannot understand. The first what i do in a script is loading the snapin for powerCLI(th add-pssnapin.ps1 that is included in the extra's folder with powercli). So if i try it with WinSSHd it works fine and load the snapins, but if i try to run it with OpenSSHD or freeSSHD it didn't works. The problem is that with this ones, powershell cannot find "HKLM:\Software\VMWare, Inc.\VMWare VDM". I tried to connect trough ssh and load the single snapin from powershell(opening powershell after i have connected through ssh), but with OpenSSH and freeSSH this path doesn't exist. My question is why is it happening with OpenSSH and freeSSH , and it doesn't with WinSSH??

    Regards



  • 2.  RE: Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 01:37 PM

    Ok, now i know why is it happening. When you launch from cmd the powershell, it launches the 32-bit version of it. So how can i launch from cmd the 64-bit version of powershell???

    Regards.



  • 3.  RE: Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 01:49 PM

    If you run %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe you will run the 64-bit version of PowerShell.

    If you run %SystemRoot%\sysWOW64\WindowsPowerShell\v1.0\powershell.exe you will run the 32-bit version of PowerShell.

    Assuming that you are running PowerShell on a 64-bit OS.



  • 4.  RE: Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 02:10 PM

    I'm running a 2008 server 64-bit. But if i launch from a cmd 32bit this: %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe it launch the 32 bit of powershell. Is it possible to run the 64 bits version of powershell from a cmd 32bit???

    Regards.



  • 5.  RE: Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 02:22 PM

    Afaik it is not possible to start 64-bit PowerShell from a 32-bit cmd.exe. You will have to use the 64-bit cmd.exe to start the 64-bit PowerShell.



  • 6.  RE: Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 02:28 PM

    The problem with that is that the cmd is openned from the ssh server(32bits), and i don't know any ssh server builded in 64bits(except WinSSH, but i'm trying to use a free alternative).

    Any idea???

    Regards.



  • 7.  RE: Problem with ssh servers and PowerCLI

    Posted Mar 06, 2012 02:47 PM

    Maybe you can use MobaSSH. It seems to have a 64-bit server version.

    But have you looked at PowerShell Remoting? That is a feature of PowerShell to run PowerShell commands on remote machines. It might be a better solution for your problem.