@martin Thank you, this points me in the right direction!
- jimbo311
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
Check
, evaluate the IsSuccess
Session.SynchronizeDirectories
?
Session.PutFiles
for that specific file.
Session.SynchronizeDirectories
:
The process cannot access the file because it is being used by another process
$updateFolder
is correct as there are say 1000 files in that path, and the random one will be missed from time to time (it is not often at all, but I am try to deal with the error handling).
Add-Type -Path "path to WinSCPnet.dll"
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.ParseUrl("ftp://${username}:$password@$url")
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
$session.PutFiles($updateFolder, "update path").Check()