0 votes
by (210 points)

Hello, I'm using Rebex.Ftp from a powershell script to connect a download files from a ftp server.
The welcome message and other info is written to the output.
¿How can I disable this? I do not want anything written to the output.

Applies to: Rebex FTP/SSL

1 Answer

0 votes
by (70.2k points)
selected by
 
Best answer

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")
...