Powershell Test-Socket

create function to test port on specific i.p to find out if its listen and can accept connection .

for this method we will use with “New-Object System.Net.Sockets.TcpClient

we’ll add it to a variable $Ping

 

so we can tell the object which IP and Port we  would like to test with it ,as this object has this members options

view all the members it has

C:\PS> $Ping | Get-Member

now lets create it in function so we can use it in a sec’ ,and make it with colors for success/false indications

 

 

 

(Visited 172 times, 1 visits today)

Leave a Reply