azure-devopscmdcommand-lineftptelnet

How to exit telnet session via command line using azure devops


I am trying to test connectivity from source to a FTP server on port 22 using azure devops commandline tool in pipelines

Command for testing: telnet TestSFTP02 22

How do I make sure the telnet connectivity is closed after running this command via the command line?


Solution

  • You will need to kill the telnet process. For example like this:

    (timeout /T 5 > nul && taskkill /f /im telnet.exe > nul) | telnet TestSFTP02 22
    

    Or use more powerful scripting language, like PowerShell.