I am calling psftp.exe from a powershell script and whilst it downloads the specified file/s correctly and functions as expected, the error (below) is thrown to the command line output which as far as I can tell has no material impact on the process as a whole.
.\psftp.exe : Looking up host "hostname.com"
At line:2 char:1
+ .\psftp.exe 'hostname.com' -l 'username' -pw 'password ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (Looking up host "hostname.com":String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Connecting to <HostIP> port <PortNo.>
Server version: <Version>
Using SSH protocol <Version>
We claim version: <Version>
Host key fingerprint is:
<key>
Using username "<username>".
Attempting keyboard-interactive authentication
Access granted
Opening session as main channel
Opened main channel
Started a shell/command
Sent EOF message
Server sent command exit status 0
Disconnected: All channels closed
Does anyone know what this error is suggesting. Surely if any of the credentials being passed were wrong the session wouldn't connect and download the files correctly?
The script is below for completeness:
.\psftp.exe 'hostname.com' -l 'username' -pw 'Pass' -P 'portNo' -v -b 'GetFiles.txt' # -be -bc
Based on the response marked as the solution, I have amended to
(.\psftp.exe 'hostname.com' -l 'username' -pw 'Pass' -P 'portNo' -v -b 'GetFiles.txt') 2> $null