Home > OS >  Powershell can as the terminal?
Powershell can as the terminal?

Time:11-05

Win10 without xp before the super terminal, usually need to configure the switches and routers, very inconvenient, heard that powershell has the function of the super terminal, but you won't configuration, consult tall person, how to configure the powershell to realize the function of the super terminal, thank you!!!!!!

CodePudding user response:

http://blogs.msdn.com/b/powershell/archive/2006/08/31/writing-and-reading-info-from-serial-ports.aspx
Suggestion of this article, Powersehll use serial communication

PSMDTAG: FAQ: How do I read/write data from a Serial Port?

Writing to a Serial Port

PS> [System. IO Ports. SerialPort] : : getportnames ()
COM3
PS> . $port=new - Object System. IO Ports. SerialPort COM3, 9600, None, 8, one
PS> $port. The open ()
PS> $port. WriteLine (" Hello world ")
PS> $port. The Close ()

Reading from a Serial Port

PS> . $port=new - Object System. IO Ports. SerialPort COM3, 9600, None, 8, one
PS> $port. The Open ()
PS> $port. ReadLine ()

For information about how to read from a serial port in an asynchronous manner in PowerShell V2, use the method DataReceived event on the port object with the Register - ObjectEvent pre-existing cmdlets.
  • Related