Skip to content

Instantly share code, notes, and snippets.

@jstrong013
Created December 19, 2019 03:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jstrong013/bc5fd9e3f3e86738e81f73bfbc6fd25b to your computer and use it in GitHub Desktop.
Save jstrong013/bc5fd9e3f3e86738e81f73bfbc6fd25b to your computer and use it in GitHub Desktop.
Example code for Send-SfRequest to Copy Item - Citrix Community Answer
# Answers question generated here: https://community.sharefilesupport.com/citrixsharefile/topics/copy-sharefile-folder-to-another-sharefile-folder-with-powershell
# If above link is dead, web archive link: https://web.archive.org/web/20191219032922/https://community.sharefilesupport.com/citrixsharefile/topics/copy-sharefile-folder-to-another-sharefile-folder-with-powershell
Add-PSSnapin ShareFile
$sfClient = New-SfClient -Name "$env:Temp\sfclient.sfps"
$itemID = #ID of the item/file you are copying
$folderDestinationID = #ID of the parent folder you are copying the file into
Send-SfRequest -Client $sfClient -Method POST -Entity Items -Id $itemID -Navigation Copy -Parameters @{ "targetid"="$folderDestinationID" }
Remove-Item -Path "$env:Temp\sfclient.sfps" -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment