Hello, it is feature of the PowerShell - if you call a method, which returns string
the string
is printed to the output.
If you don't want to print the message, just simply store the returned value to a variable.
For example, we can see the output you are talking about at this blog post https://blog.rebex.net/how-to-use-FTP-or-SFTP-in-PowerShell
Instead:
PS C:\> $ftp.Connect("test.rebex.net")
PS C:\> $ftp.Login("demo", "password")
Use for example this:
PS C:\> $x = $ftp.Connect("test.rebex.net")
PS C:\> $x = $ftp.Login("demo", "password")