Windows offers a ssh client. In Powershell I can connect with ssh user @ server.
How can I use the client in a script while passing credentials?
There are examples on the net about New-PSsession:
$ session = New-PSSession -HostName WinVM2 -UserName PSRemoteUser
Powershell Version 5.1 / New Pssession does not know the parameters hostname and username.
The following have no Error but the script hangs:
$ session = New-PSSession -SSHTransport -ComputerName 192.168.2.50 -Credential root
If you use ssh user @ server directly in the script you will not be asked to enter a password.
Other modules should not be installed.
Does one have an idea?