Check Remote Desktop Protocol Port
Test-NetConnection -Computer $Server -CommonTCPPort RDP
Details
Using the Test-NetConnection cmdlet you can confirm that a server is reachable via the standard RDP port of 3389.

Example
PS C:\> $Server = 'AD01'
>> Test-NetConnection -Computer $Server -CommonTCPPort RDP



ComputerName     : DC01
RemoteAddress    : 10.10.5.12
RemotePort       : 3389
InterfaceAlias   : vEthernet (External (NIC))
SourceAddress    : 10.10.5.200
TcpTestSucceeded : True


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