Hi Jim
The code is very simple, I can connect using ssh but when I execute a command I get the following error:-
Enter-SshSession : Exception calling "RunCommand" with "1" argument(s): "Session operation has timed out"
Code below:-
New-SshSession -ComputerName <myipaddress> -Username 'myservername\username' -Password 'mypassword' -port 22
Enter-SshSession -ComputerName <myipaddress>
try{
$results = Invoke-SshCommand -Command 'mkdir c:\test' -ComputerName <myipaddress>
}
catch {
finally
{
Remove-SshSession -RemoveAll
$results = Invoke-SshCommand -Command
The code is very simple, I can connect using ssh but when I execute a command I get the following error:-
Enter-SshSession : Exception calling "RunCommand" with "1" argument(s): "Session operation has timed out"
Code below:-
New-SshSession -ComputerName <myipaddress> -Username 'myservername\username' -Password 'mypassword' -port 22
Enter-SshSession -ComputerName <myipaddress>
try{
$results = Invoke-SshCommand -Command 'mkdir c:\test' -ComputerName <myipaddress>
}
catch {
Write-host $($Error[0].Exception.Message)
} finally
{
Remove-SshSession -RemoveAll
Get-SshSession
} $results = Invoke-SshCommand -Command