windows check serial ports in use code example
Example 1: how to check for open ports in windows
netstat -an
Example 2: powershell connect to serial port
Copied![System.IO.Ports.SerialPort]::getportnames()
netstat -an
Copied![System.IO.Ports.SerialPort]::getportnames()