Search Folders / foreach loop upload
Hi guys
I'd like to mirror the powershell command:
in a way that instead of moving files from one local folder to another the files are moved to an SFTP (the SFTP session is working fine and uploading files is not a problem in general.)
This is what I'd attempted to do:
But this set up doesn't work in the same way, could someone please tell me I can set this up correctly?
Thanks
I'd like to mirror the powershell command:
foreach ($folder in $folderarray) { Copy-Item "D:\Users\username\*\*\*\$folder\files\*" -Destination "D:\Users\username\Desktop\temp\" -Recurse }
in a way that instead of moving files from one local folder to another the files are moved to an SFTP (the SFTP session is working fine and uploading files is not a problem in general.)
This is what I'd attempted to do:
foreach ($folder in $folderarray) { $session.PutFiles("D:\Users\username\*\*\*\$folder\files\*", "/NewRelease/$folder/", $False, $transferOptions)
But this set up doesn't work in the same way, could someone please tell me I can set this up correctly?
Thanks