Get but skip entire folder if folder timestamp is not new/updated (PowerShell)

Advertisement

windshear
Joined:
Posts:
2
Location:
Danvers, MA

Get but skip entire folder if folder timestamp is not new/updated (PowerShell)

Hello,
Is there a way during a get operation to skip checking for new files in folders if the local folder already exists?
I don't want to compare to existing folders that have a thousand tiny files in them, checking each file individually. I want to just skip the entire folder if it already exists in the local folder.

Current code is like this:
    "open sftp://user:pass@remotesite.com/ -hostkey='xxx'"
    "cd /remotefolder" `
    "lcd C:\localfolder" `
    "get -preservetime=all -neweronly *" `
    "exit"

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,336
Location:
Prague, Czechia

Re: Get but skip entire folder if folder timestamp is not new/updated (PowerShell)

No, there's no such option.
You would have to code such logic completely using PowerShell and WinSCP .NET assembly.

Reply with quote

Advertisement

You can post new topics in this forum