Powershell is cutting off long output when connected to a terminal via SSH

421 views Asked by At

To put some context, I use the Posh SSH module to connect to linux machines on other servers and invoke command to get information of the current health of the machine.

When I use the command :

Invoke-SSHCommand -Index 0 -Command "vm_manage.sh status"

I got a truncated output of the command : output

This is normally the correct output for the command :

outputok

How can I make sure that I have the full output in powershell ?

Thanks a lot

1

There are 1 answers

0
su7 On

Adding parameter -ShowStandartOutputStream is enough to have the correct output

Invoke-SSHCommand -Index 0 -Command "vm_manage.sh status" -ShowStandartOutputStream