Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy-SFItem from 1 root folder to another #70

Open
vsantoro opened this issue Jul 11, 2022 · 0 comments
Open

Copy-SFItem from 1 root folder to another #70

vsantoro opened this issue Jul 11, 2022 · 0 comments

Comments

@vsantoro
Copy link

I am trying to copy a root folder and all subfolders & files to another root folder. This works fine but only if the folder is empty. I tried using these switches -Force and -OverWrite, neither work. Anyone know how to get this to keep copying files even when there are already files there ? If they are there it should just skip, even an overwrite would work, just want to schedule this to run monthly but cant figure out a way to get it to go.

Add ShareFile PowerShell Snap-in

Add-PSSnapin ShareFile

#Run the following interactively to create a login token that can be used by Get-SfClient in unattended scripts
#$sfClient = New-SfClient -Name ((Join-Path $env:USERPROFILE "Documents") + "\test.sfps") #-Account YourSubdomain
$sfClient = Get-SfClient -Name ((Join-Path $env:USERPROFILE "Documents") + "\test.sfps")

#Create var
$ProdFolders = "S:\Shared With Me\test1"
$Backup = "S:\Shared With Me\test1archive"

#copy the test root folder to the test archive folder
Copy-SFItem $ProdFolders $Backup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant