user3228907
user3228907

Reputation: 11

Requesting info from a device connected to a com port using PowerShell

I'm using Windows PowerShell Integrated Scripting Environment (ISE). What I'm trying to do is get setup information from a solar inverter that is connected via com3,115200,8,and 1 data bits. I bought this inverter and there is no brand name or model #. So I'm trying to open com port and get any info that I can, to help with setup. I have very little experience writing code.

Upvotes: 0

Views: 697

Answers (1)

Guy Thomas
Guy Thomas

Reputation: 933

Originally, I thought this would be a job for WMI, then I discovered this example, which I thought you may be able to modify:

[$port = new-Object System.IO.Ports.SerialPort COM6,115200,None,8,one
$port.Open()
$port.WriteLine( "at+csq" + "`r" )
start-sleep -m 50
$port.ReadExisting()
$port.Close()][1]

Upvotes: 1

Related Questions