View Only
  • 1.  Unable to Get Complete vim-cmd Output using Posh-SSH

    Posted Apr 24, 2021 03:23 AM

    I've never encountered this issue before with Posh-SSH.

    I'm trying the following vim-cmd commandvim-cmd hbrsvc/vmreplica.getState vmID and the complete output is not showing with the exitstatus=1 

    The command to get the vmID works fine > Invoke-SSHCommand $ssh -Command "vim-cmd vmsvc/getallvms | grep "VM Name" 

    The command to get VM Replica state does not work > (Invoke-SSHCommand $ssh -Command "vim-cmd hbrsvc/vmreplica.getState 24").output 

    KB Article Related to these command below.

    This does work perfectly via Putty or Terminal, Hope someone can help?






  • 2.  RE: Unable to Get Complete vim-cmd Output using Posh-SSH
    Best Answer

    Posted Apr 24, 2021 03:41 AM

    Never mind All, I figured it out, I needed to use Invoke-SSHStreamShellCommand

    Invoke-SSHStreamShellCommand -ShellStream $stream -Command "vim-cmd hbrsvc/vmreplica.getState 24"