Source folder is always created in the target

  • 1
  • Question
  • Updated 12 months ago
I am trying to sync a network folder with Sharefile, and it works great, but I don't want the source folder to get created in the destination folder.  I only want the content of the source folder to sync, not the folder itself.  I would have to delete everything we currently have up there.  I am NOT using the -CreateRoot option.  This is what I"m using:

New-PSDrive -Name sfdrive -PSProvider ShareFile -Root "/" -Client $sfClient

Sync-SfItem -LocalPath "\\hostname\temp" -Synchronize -Upload -ShareFilePath "/Test" -Recursive -Strict

Remove-PSDrive sfdrive

Thanks for any help.
Photo of Eric

Eric

  • 7 Posts
  • 1 Reply Like

Posted 1 year ago

  • 1
Photo of Michael Berrier

Michael Berrier, Official Rep

  • 123 Posts
  • 24 Reply Likes
Hi Eric,

You should be able to achieve what you want by changing the -LocalPath parameter value to:
"\\hostname\temp\*"

Let me know if that does the trick.

Michael
Photo of Eric

Eric

  • 7 Posts
  • 1 Reply Like
I tried that previously, and you are correct, it does do it, however, when you do that, then the -Strict option doesn't seem to work anymore.  With the * added at the end, if I delete files from the source local target, it doesn't delete them from the Sharefile target folder anymore.  
Photo of Michael Berrier

Michael Berrier, Official Rep

  • 123 Posts
  • 24 Reply Likes
Eric,

Ah, understood. That sounds like it could be a defect, but I've asked our PowerShell SDK experts to take another look at this and get back to you.

Michael
Photo of Eric

Eric

  • 7 Posts
  • 1 Reply Like
How long does it typically take to hear back from someone?  I'm just trying to determine if I have to blow up our current folder structure, or wait for a fix.  Thanks.
Photo of Michael Berrier

Michael Berrier, Official Rep

  • 123 Posts
  • 24 Reply Likes
Eric,

Apologies for the delay. I've requested an update for you.

Michael
Photo of Vikas

Vikas

  • 1 Post
  • 2 Reply Likes
Hi Eric,

Can you please give this build a try : https://citrix.sharefile.com/d-sdb4c7b6da0346419
Let us know if that works for you.

-Vikas
Photo of Eric

Eric

  • 7 Posts
  • 1 Reply Like
Worked like a charm with that one.  Thank you so much!