Pages

Wednesday, May 11, 2016

PowerShell cmdlet of the Day : Test-Connection

Ping! I can bet, that you use this command almost daily. We use Ping.exe to test networking by pinging IP Addresses or hostnames. If the reply comes then we know networking is working fine and if we get RTO's , then we know, networking is not working.In PowerShell we have a cmdlet Test-Connection which does the same. The usage is simple, type the Cmdlet Test-Connection and in -Count parameter provide the numbers of Pings you want to send.Test-Connection 8.8.8.8 -Count 3 Cool! Actually the most cool thing is , this cmdlet's -Quiet switch parameter. When we provide the -Quiet parameter, the output comes in True or False ( Awesome!!!). If your IP/Host is reachable , then the output result will be True, otherwise it will be False. This comes quite handy when you need to do some network availability checks in to your script.:)