How to continuously read Serial COM port in Powershell and occasionally write to COM port
问题 I need to know how I can continuously read data in from the COM port and dump it to a file using Windows Powershell. While I am reading data in, I also need to monitor the data being read in and, depending on what the last line that was read, write data to the COM port. To open the COM port in Powershell, I am doing this: [System.IO.Ports.SerialPort]::getportnames() $port= new-Object System.IO.Ports.SerialPort COM3,115200,None,8,one $port.open() To read data in to the COM port, I am doing