Re: Help transferring files using wildcards in PowerShell
You are welcome. Thanks for considering a donation to our project!
$transferOptions.FileMask = "90_FINISH.CHECKS.ISSUED_*,90_FINISH.AP.DETAILS_*"
...
$sourcepath = "/data/STORAGE/_HOLD_/*"
$SessionOptions.DisableVersionCheck
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::sftp
$sessionOptions.HostName = "host"
$sessionOptions.UserName = "user"
$sessionOptions.Password = "password"
$sessionOptions.SshHostKeyFingerprint = "XXXXXX"
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.FileMask = "|90_FINISH.CHECKS.ISSUED_*","|90_FINISH.AP.DETAILS_*"
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::Off
$sourcepath = "/data/STORAGE/_HOLD_"
$destpath = "c:\ToProcess\"
$session.PutFiles($sourcepath, $destpath, $True, $transferOptions)