Persist console with winrm and powershell
-
06-06-2021 - |
Question
I just started working with powershell to automate a process, and now I'm stuck with win remoting. I enabled remoting on the machine I want to connect to and can execute a singleline command easily, e.g.
winrs -r:http://$servername:5985 -u:$user "dir c:\"
And after that command is executed the remote shell is done and i need to write winrs -r... again everytime I need to execute a command. Is there any way to stay in the remote computer's console, like when I'm telneting or connecting with ssh?
Solution
In PowerShell try:
Enter-PSSession -ComputerName $servername
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow