PowerShell TCP Listener

PowerShell uses the following commands to open a socket on a specific port via System.NET:

$endpoint = new-object System.Net.IPEndpoint([ipaddress]::any,80)
$listener = new-object System.Net.Sockets.TcpListener $endpoint
$listener.start()
$data = $listener.AcceptTcpClient()

The commands can be used for simulating a network service, as an example to test the network connection before the actual network service is installed, see also: PING with Port - Windows cmd | PowerShell: Test-Netconnection

positive Bewertung({{pro_count}})
Rate Post:
{{percentage}} % positive
negative Bewertung({{con_count}})

THANK YOU for your review!

created by Bernhard | published: 2022-08-12 | Updated: 2022-08-12 | Übersetzung Deutsch |🔔 | Comments:0

Questions / Comments


 
By continuing to browse the site, you agree to our use of cookies. More Details