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

Advertisement

David Griswold
Joined:
Posts:
1
Location:
Omaha, NE

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

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.

Thanks,
David Griswold

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

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

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.

Reply with quote

Advertisement

You can post new topics in this forum