BornToBeRoot/PowerShell_BrocadeICX

Connection Error

anvers opened this issue · 3 comments

Hi,

i have a problem with try to execute the example "New-BrocadeSession -ComputerName TEST_DEVICE1"

My switch is a brocade icx 6430 and the ip is 172.20.2.105. they have configure SSH.

When try with "New-BrocadeSession -ComputerName 172.20.2.105", put my credentials but bring me back this error:

errorbrocade

PS C:\Users\nsangregorio\Documents\WindowsPowerShell\Modules> New-BrocadeSession -ComputerName 172.20.2.105
New-SSHSession : Sequence contains more than one element
En C:\Users\nsangregorio\Documents\WindowsPowerShell\Modules\Brocade\Brocade.psm1: 85 Carácter: 45

  •                $created_SSH_Session = New-SSHSession <<<<  -ComputerName $ComputerName1 -Credential $Credentials
    
    -AcceptKey
    • CategoryInfo : InvalidOperation: (Renci.SshNet.SshClient:SshClient) [New-SSHSession], InvalidOperationE
      xception
    • FullyQualifiedErrorId : SSH.NewSshSession

172.20.2.105: No se puede llamar a un método en una expresión con valor NULL.
PS C:\Users\nsangregorio\Documents\WindowsPowerShell\Modules>


Thanks !!

Nicolas

I will take a look at this when I get back from my vacation.

I work currently on a new (much better) version, but i need some more time: https://github.com/BornToBeRoot/PowerShell_BrocadeICX/tree/Dev

Maybe you could try this code, to check if you can establish an SSH connection and create an SSH stream:

$created_SSH_Session = New-SSHSession -ComputerName "HOSTNAME" -Credential (Get-Credential) -AcceptKey
$SSH_Session = Get-SSHSession -SessionId $created_SSH_Session.SessionID
$SSH_Stream = $SSH_Session.Session.CreateShellStream("dumb", 0, 0, 0, 0, 1000)

Posh-SSH must be installed.

Closed. No Feedback...