Powershell control of IP2CC-P

I'm stuck trying to get this to work.  My powershell script:

[string]$RelayClosed= "setstate,1:1,1`r"
$s = new-object System.Net.Sockets.TcpClient("", 4998)
$str = $s.GetStream()
$wrtr = new-object System.IO.StreamWriter($str)
start-sleep -m 500


Doesn't set the relay.  I can control the relay from iTest.  If I redirect the script to my PC running nc I see what I should: setstate,1:1,1 with a carriage return (Ctrl M).  As best I can tell, it should work.  Can anyone help?


Please sign in to leave a comment.