powershell read/write commands

Welcome Forums General PowerShell Q&A powershell read/write commands

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
3 months, 3 weeks ago.

  • Author
    Posts
  • #105022

    Participant
    Points: 0
    Rank: Member

    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()

  • #105379

    Keymaster
    Points: 1,625
    Helping HandTeam Member
    Rank: Community Hero

    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!

The topic ‘powershell read/write commands’ is closed to new replies.