Powershell posh-ssh: How to store results of Invoke-SSHCommand?

Question:

How can I store the result of Invoke-SSHCommand for use after I close the connection?

I’ve tried 2 different ways:

The variable $result is empty after both methods

Answer:

This worked well for me :

Source:

Powershell posh-ssh: How to store results of Invoke-SSHCommand? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply