powershell read/write commands

im trying to turn on and off a numato usb relay using powershell but i am not etting it to work. i know i am using the correct commands because it works with putty, but whenever i run the code on powershell nothing happens. The code i am using is below

$port = new-Object System.IO.Ports.SerialPort COM4,9600,None,8,one
$port.Open()
$port.WriteLine(“relay on 0”)
$port.Close()

Sorry you haven’t had an answer here - this is really a .NET Framework question more than PowerShell, since you’re directly accessing .NET. You might have more luck on a developer-centric forum like StackOverflow.com. Best of luck!