SFTP Remote Path Folder name needs wildcard

Advertisement

Hackathon2020
Joined:
Posts:
1
Location:
Bucharest

SFTP Remote Path Folder name needs wildcard

Hello! I'm dealing with a tricky issue right here. I need to download through sftp to local a file that is daily written on remote. The issue is that the remote source folder name it's changing daily with the format "folder_2020MMDDHHMMSS". Each day is created a new file at different hours, so the folder name will differ every day (cannot use get-date).
How can I use sort of wildcard in the remote source path?

I want to mention that I've tried get-childitem, resolvePath and invoke command, no luck at all.

any help, please

thank you
$session.GetFiles($sourcefolder,"destinationfolder", $false, $transferOptions).Check()
$sourcefolder it's something like :"/folder/folder_20200310223045"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
33,710
Location:
Prague, Czechia

Re: SFTP Remote Path Folder name needs wildcard

Sorry, this is too vague. Are there other folder in the /folder? If there are, how do you identify the one you want to download? Is it the latest one? Is it the one with today's date in the file name? Do you have to use the file name for the decision? Cannot you you a file timestamp?

Reply with quote

Advertisement

You can post new topics in this forum