You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: