Topic "Powershell session.putfiles: Getting 'Host "hostname sourcefile destfile" does not exist'"

Author Message
David Griswold
[View user's profile]

Joined: 2016-01-13
Posts: 1
Location: Omaha, NE
I am using the Powershell putfile example, with a few changes, and wrapped in a function. When I call $session.putfiles I get a strange error (sanitized):

Host "hostname.domain c:\localpath\localfile /remotepath/remotefile" does not exist.

I only need to copy one file and it exists on the remote side, but I think I read that overwrite is true by default. I had a wildcard in the source originally, but I changed it to have the exact filename.

I know that the host exists, because steps in the script before the call to copy the file work with the same variables. Let me know if you need me to include my code.

David Griswold
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
Show us your code and a full session log file showing the problem (using the latest version of WinSCP).

To generate log file, set Session.SessionLogPath. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License