Posh-ssh switch HP2530

This topic contains 3 replies, has 3 voices, and was last updated by  Max Kozlov 2 months, 2 weeks ago.

  • Author
    Posts
  • #76647

    Dimitri
    Participant

    Hello friends, how are you? 🙂
    Please see if you can help me ... I use Posh-ssh to manage Mikrotik routerboards and it works perfectly. However now I want to
    Also automate configuration of switches (in my scenario, they are all
    HP 2530-24G). I can connect normally via posh-ssh (it appears in the
    Log switch as logged), however, any command I try
    Invoking it does not recognize ... I believe it is by the following: – In that
    Swich template, when I log in for the first time, it is necessary to press the
    Enter to be able to fully start the session .... However I do not know how
    Invoking this command by posh / powershell .... do you have any ideas?
    I found something in this sense but I do not know how to use:

    # $ Test = new-object -c wscript.shell
    # $ Test.sendkeys ("{ENTER}")

    Note: I am invoking the commands as follows:

    Invoke-SSHCommand -Command "system-view" -SessionId 0
  • #76809

    Don Jones
    Keymaster

    Have you tried "`n" to send a carriage return?

    • #76815

      Dimitri
      Participant

      Yes, not work. 🙁

  • #76821

    Max Kozlov
    Participant

    I believe you need to use New-SSHShellStream instead of New-SSHSession

You must be logged in to reply to this topic.