1
It's because telnet is an interactive program. Powershell doesn't handle interactive programs like telnet, because I had the same issue using git when it's supposed to prompt you for credentials. This person here had the same issue as us basically. I haven't tried it myself, but maybe telnet cmdlets in this powershell module is worth a shot.
What do you mean by "new line just starts"? How did you establish the PS session? What did you do to make the
telnet
command to be run on the session rather than local? – Seth – 2017-01-10T09:46:55.027Due to firewall rules i can't telnet to the device from my machine. Also added a screenshot – WagoL – 2017-01-10T09:55:47.003
The computer name is placed in front of the telnet line after you use
Enter-PSSession
, you forgot to redact it in that space. So it does work if you use the same machine? You could try to check$?
for an error code that would indicate thattelnet
wasn't run successfully. – Seth – 2017-01-10T09:59:48.630TY Redacted it now :). When I first run the
telnet
and then$?
it saystrue
. I have no idea what that means. Better should've posted I'm new to PS. – WagoL – 2017-01-10T10:03:29.427It would tell you whenever the last command ran successfully. See this and this. So you do get a connection if you directly RDP into the server using the same user?
– Seth – 2017-01-10T10:14:08.677This is the same user but in RDP session screenshot. What I think is wrong after reading up, is that telnet is not using the PS stdin/stdout. But I could be wrong.
– WagoL – 2017-01-10T10:29:13.680Indeed it appears that telnet is "broken" in this case. You could look into a solution like this if you want to use PS for it. Otherwise consider using an alternative client like putty which supports parameters.
– Seth – 2017-01-10T10:55:12.403