Add scripts
This commit is contained in:
parent
422934aef7
commit
350807c951
30 changed files with 574 additions and 0 deletions
15
Scripts/Start-TCPServer.psm1
Normal file
15
Scripts/Start-TCPServer.psm1
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
function Start-TCPServer {
|
||||
param(
|
||||
$Port = 5201
|
||||
)
|
||||
do {
|
||||
$TcpObject = New-Object System.Net.Sockets.TcpListener($port)
|
||||
$ReceiveBytes = $TcpObject.Start()
|
||||
$ReceiveBytes = $TcpObject.AcceptTcpClient()
|
||||
$TcpObject.Stop()
|
||||
$ReceiveBytes.Client.RemoteEndPoint | select Address,Port
|
||||
} while (1)
|
||||
}
|
||||
|
||||
# Start-TCPServer -Port 5201
|
||||
# Test-NetConnection -ComputerName 192.168.3.99 -Port 5201
|
||||
Loading…
Add table
Add a link
Reference in a new issue