I was recently researching how to read from a COM (Serial) port in order to communicate with an old embedded system. If you're not familiar with them that's one of these:
C# provides the
SerialPort class for just this purpose which is hugely helpful. However there's one problem with this class which is that it's just not... very good. I didn't know about this but this post by Ben Voigt should leave you in no doubt that it has some problems.
In order to test the code on my machine without access to the actual device which was elsewhere, I installed Eltima's Virtual Serial Port Driver which would allow me to test with emulated serial ports. Once I had set up a pair of ports I could send data from one end using PowerShell.