Execute multiple commands via SSH and PowerShell
问题 I successfully managed to connect to a Cisco IE-2000-L switch via SSH. I used the Renci SSH.NET library. Starting guide: http://vwiki.co.uk/SSH_Client_(PowerShell) My working code is # Load SSH library (for .NET 4.0 and PowerShell 3) $DllPath = "D:\temp\Renci.SshNet.dll" [void][reflection.assembly]::LoadFrom( (Resolve-Path $DllPath) ) # Connect to switch (Cisco IE2000-L) with IP, port, username, password $SshClient = New-Object Renci.SshNet.SshClient('172.20.91.30', 22, 'admin', 'mypassword')