PortL

[int]$port_num = Read-Host -Prompt "give me a port"
$Listener = [System.Net.Sockets.TcpListener]$port_num;
$Listener.Start();
Read-Host -Prompt "listening to the port $port_num, hit enter to stop"
$Listener.Stop();