Telnet alternative to check if port is open on host

Posted on 26.02.18   Powershell Scripting Telnet

Many people still use telnet (client) for checking if port is open on remote host.
The Powershell cmdlet Test-NetConnection is the new and improved tool for this and by creating a function alias in your profile settings you can have it easily available at any time without remembering the syntax.

1) Open Powershell profile
notepad $profile

2) Add script
function open([string]$arg1, [int]$arg2)
{
     Test-NetConnection -ComputerName $arg1 -Port $arg2 -InformationLevel Detailed
}

3) Save file and close/reopen the Powershell window

4) Test it in your powershell prompt by writing open google.com 80

More on ITDB

Managing WiFi profiles in Windows 10


Turn off CTRL + ALT + DEL at login prompt Windows 10


Fix twitchy/wobbling touchpad for Ubuntu based distributions


How to debug a non starting application with ProcMon


Create a cmd alias/shortcut for issuing commands on remote computer