$socket = new-object Net.Sockets.TcpClient
$socket.Connect($IPAddress,$Port)
$socket.Connected
Just supply an IP Address and Port number and it will return true or false, based on if it was able to connect.
$socket = new-object Net.Sockets.TcpClient
$socket.Connect($IPAddress,$Port)
$socket.Connected
Details