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. https://kb.vmware.com/s/article/2148376
This does work perfectly via Putty or Terminal, Hope someone can help?
Never mind All, I figured it out, I needed to use Invoke-SSHStreamShellCommand
Invoke-SSHStreamShellCommand -ShellStream $stream -Command "vim-cmd hbrsvc/vmreplica.getState 24"
View solution in original post