Skip to content

Instantly share code, notes, and snippets.

@jstrong013
Last active December 6, 2019 18:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jstrong013/b79bb36a29350b67df480b269231d3ca to your computer and use it in GitHub Desktop.
Save jstrong013/b79bb36a29350b67df480b269231d3ca to your computer and use it in GitHub Desktop.
Example Code for Sync-SfItem - Citrix Community Answer
# Answers question Generated here: https://community.sharefilesupport.com/citrixsharefile/topics/sync-sfitem-command-not-working
Add-PSSnapin ShareFile
$sfClient = Get-SfClient -Name "$env:Temp\sfclient.sfps"
New-PSDrive -Name sfDrive -PSProvider ShareFile -Client $sfClient -Root "\"
# Name Used (GB) Free (GB) Provider Root
# ---- --------- --------- -------- ----
# sfDrive ShareFile \
Sync-SfItem -LocalPath "C:\PowerShell\ShareFile\TEST\*.txt" -Upload -ShareFilePath "sfDrive:\Folder Example" -OverWrite
# Sync operation successfully completed.
Remove-PSDrive -Name sfDrive
Remove-Item -Path "$env:Temp\sfclient.sfps" -Force
@Lehmancreations
Copy link

This worked Great. Thanks for providing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment