0

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("10.1.5.129", 4998)
$str = $s.GetStream()
$wrtr = new-object System.IO.StreamWriter($str)
$wrtr.Write("$RelayClosed");
start-sleep -m 500
$wrtr.Flush();
$wrtr.Close();
$s.Close()

 

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?

3 comments

Please sign in to leave a comment.