Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Nobody can help me? Please

Ohhh ok, so it do not working with $transferOptions.FileMask ?
Do you have a Code Snippet for the other possibility please?

Re: Upload Folders with FileMask <yesterday .NET

The time constraints do not work for directories:
If you want to select directories based on their timestamps, you will have to code that in your PowerShell script.

Upload Folders with FileMask <yesterday .NET

Hi guys,

I am trying to write a automation for a SFTP Upload and need you help.
How can I realize to upload folders older than yesterday? I am scripting in PS with .NET Assembly. Here are my code snippet:

$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.FileMask = "<1D"
$transferResult = $session.PutFiles($source, $destinationSFTP, $False, $transferOptions)

I do not get a Fault in the Debugwindow and the Script put all Files on the SFTP
Whats wrong with this?

In addition I want to put the uploaded Folders in a Subfolder with Overwriting if the Folder has been in the Subfolder. To realizing this I am trying to do this but still getting the Error-Message that the file cannot be created if it already exists.

Move-Item -Path $Sourcelocation -Destination $subfolder -Force -Recurse

Do you have a idea?

Thanks for your help!