Forked from jstrong013/Sync-SfItem_Example1.ps1
Last active
December 6, 2019 18:24
-
-
Save Lehmancreations/41711507e9566f1192359f7aa92cff52 to your computer and use it in GitHub Desktop.
Example Code for Sync-SfItem - Citrix Community Answer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# The Sharefile folder can either point to a personal folder or a shared one. just use the name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment