1

My code as below:

$ShareFileHomeFolder = (Send-SfRequest $sfClient -Entity Items).Url

New-PSDrive -Name sfDrive -PSProvider ShareFile -Client $sfClient -Root "\" -RootUri $ShareFileHomeFolder 

Copy-SfItem -Path $File.FullName -Destination "sfDrive:\Test"

Remove-PSDrive sfdrive

Current: It's copy the files unto Personal Folders\Test

This is what I want to achieve: How can I copy the files unto Shared With Me\Reports\Folder1?

Please advise.

Thanks.

Regards, Micheale

Micheale
  • 65
  • 1
  • 1
  • 7

1 Answers1

1

Thanks. I managed to solved it.

#$_.Id is the folder ID you want to upload; xyz is your organisation
            
$ShareFileHomeFolder = "https://xyz.sf-api.com/sf/v3/Items("+$_.Id+")"          
            
##Create a PowerShell provider for ShareFile at the location specified
            
New-PSDrive -Name sfDrive -PSProvider ShareFile -Client $sfClient -Root "\" -RootUri $ShareFileHomeFolder
            
Copy-SfItem -Path $File.FullName -Destination "sfDrive:"
            
Remove-PSDrive sfdrive

Thanks.

Regards, Micheale

Micheale
  • 65
  • 1
  • 1
  • 7