How to handle uploads from 2 locale paths to one parent remote folder
Hi
I've been working on an PowerShell script, which should upload multiple local folders to a FTP server. But I can't get it to work, as I want.
I'm using SynchronizeDirectories, but perhaps I should use something else, but what?
The problem is, that I need to upload 2 locale paths to one same folder parent folder on the FTP, and when it handles the first upload it will delete everything that doesn't correspond to the locale folder.
On the other hand, it should also delete files or folders on FTP, that aren't in the locale path any longer.
How do I handle that?
My paths are in a array like:
and the synchronization is like
I've been working on an PowerShell script, which should upload multiple local folders to a FTP server. But I can't get it to work, as I want.
I'm using SynchronizeDirectories, but perhaps I should use something else, but what?
The problem is, that I need to upload 2 locale paths to one same folder parent folder on the FTP, and when it handles the first upload it will delete everything that doesn't correspond to the locale folder.
On the other hand, it should also delete files or folders on FTP, that aren't in the locale path any longer.
How do I handle that?
My paths are in a array like:
$localePathArray = @( "\\server\Tekla\Tekla\TS2017i", "\\server\dfs\Produktion\0 - RIMTO\VBProj\DS Checker\Poka installation", "\\server\dfs\Produktion\0 - RIMTO\VBProj\DS PDF Merger\Poka installation", "\\server\Install\Tekla\DS installation", "\\server\dfs\Produktion\0 - RIMTO\VBProj\DS Checker\sync files" ) # Put FTP share into array $remotePathArray = @( "/P3D/TS2017i/system/", "/P3D/TS2017i/clickonce applications/DS Checker/", "/P3D/TS2017i/clickonce applications/DS PDF Merger/", "/P3D/TS2017i/installation/", "/P3D/TS2017i/clickonce applications/DS Checker/sync files/" )
$TransferOptions.FileMask = "null" # Synchronize files for ($i=0; $i -lt $localePathArray.length; $i++) { # Write-Host "$localePathArray[$i] $remotePathArray[$i]" $synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Remote, $localePathArray[$i], $remotePathArray[$i], $True, $False, [WinSCP.SynchronizationCriteria]::Time, $TransferOptions) }