If you have never installed any modules from PS Gallery you can run the below command so that you do not get the Untrusted Error.
Need to change the Execution Policy or you will throw an Error
Need to go ahead and install the Posh-SSH module
We are adding on the -RequiredVersion switch as that is the stable version. There is a 2.1 version, but suggested version and this guide uses the 2.0.2 version.
Import the module of Posh-SSH to make the commandlets available for use.
Now you can verify this by running a Get-InstalledModule command and should output the Posh-SSH Module
Just for to see what we can do:
Let us now go ahead and run the Get-Command and see what Commandlets and functions are available within the Posh-SSH module
Initiate an SSH Session with the following command
Even though the switch says ComputerName you can go ahead and put an Ip Address there. We are also going ahead and added the -AcceptKey to accept the RSA key of that SSH session. A Credentials popup window will come up to fill in the login creds, and this can be automated. For now we will just manually fill in the credentials.
Now you have established a session with your remote SSH enabled device. Be on the look out for another post on how to use Posh-SSH with a SonicWall UTM appliance.