Upload using PowerShell without creating a new folder

  • 1
  • Question
  • Updated 1 month ago

I'm trying to convert SFCLI language over to Powershell and am a complete novice on the coding.  I've got most of the coding transitioned but I’m trying to determine how to upload to Sharefile without creating a new folder.  For example, the following script creates a new folder called “Sample, Bob and Betty” under Invoices.  I just want the documents to upload to the Invoices folder, not create a new folder.

 Sync-SfItem –LocalPath  "C:\Users\jason\Desktop\Invoices\Sample, Bob and Betty\” -upload -ShareFilePath "/Private Client Documents/Sample, Bob and Betty/Invoices/”

Photo of Jason

Jason

  • 1 Post
  • 0 Reply Likes

Posted 1 month ago

  • 1
Photo of Luke Skrzypek

Luke Skrzypek, Employee

  • 58 Posts
  • 7 Reply Likes
Hi Jason,

To accomplish that behavior you can add a wildcard character to the end of your -LocalPath. So it will look like this:
Sync-SfItem –LocalPath  "C:\Users\jason\Desktop\Invoices\Sample, Bob and Betty\*” -upload -ShareFilePath "/Private Client Documents/Sample, Bob and Betty/Invoices/”
That will upload all the files in your local folder to the Invoices folder in ShareFile. The way you have it currently uploads the folder itself, and all of its contents.


(Edited)