Answer the question
In order to leave comments, you need to log in
How to automate router reboot via SSH via Powershell?
Hello)
I want to create a script that will allow me to reboot the router by double clicking on the shortcut, instead of going into the web interface and doing everything manually.
Through Powershell, I understand how to do it with my hands:
ssh [email protected]
"enter password"
"press Enter"
reboot
But I don't understand at all how to automate this process through PowerShell, since I have never worked with it. I thought it was simple, in the spirit of creating batch files (one of these, for example, I reboot the machine via RDP, because the Windows developers removed the "reboot" item when connecting remotely), but this, as it turned out, does not work that way.
I found a few examples, found out that there seems to be a SendKeys command, and even tried to apply it, but it didn’t work:(
Please help)
Answer the question
In order to leave comments, you need to log in
Try to install the Posh-SSH module and use the cmdlets from its composition according to the instructions from here https://habr.com/en/post/314990/
It should be suitable for your task.
You can use putty specifying the log/pass file
Or just type it in the batch file
Why do you need to restart the router?)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question