Power shell script wincsp synchronizedirectories file mask not working
Hi,
this is my first post to the forum so I hope someone can help.
I have a PowerShell script with the following code
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = $Remote_Host
$sessionOptions.UserName = $UserName
$sessionOptions.Password = $Password
$Session.SessionLogPath
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
$transferoptions= New-Object WinSCP.TransferOptions
$transferOptions.FileMask = "*.TXT | RESULT*"
# Synchronize files to local directory, collect results
$synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::local, $localPath, $remotePath, $False, $TransferOptions)
It works fine except the file mask does not exclude the RESULT* files in the directory. Am I doing something wrong?
WinSCP version is WinSCP 5.7.5
Windows version is server 2012
Many thanks for any help
Steve
this is my first post to the forum so I hope someone can help.
I have a PowerShell script with the following code
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = $Remote_Host
$sessionOptions.UserName = $UserName
$sessionOptions.Password = $Password
$Session.SessionLogPath
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
$transferoptions= New-Object WinSCP.TransferOptions
$transferOptions.FileMask = "*.TXT | RESULT*"
# Synchronize files to local directory, collect results
$synchronizationResult = $session.SynchronizeDirectories([WinSCP.SynchronizationMode]::local, $localPath, $remotePath, $False, $TransferOptions)
It works fine except the file mask does not exclude the RESULT* files in the directory. Am I doing something wrong?
WinSCP version is WinSCP 5.7.5
Windows version is server 2012
Many thanks for any help
Steve