Log to find out which folder is the problem

  • 1
  • Question
  • Updated 11 months ago
My Move job is failing due to file path being too long, but I don't know whcih folder or file it's failing on.  How can I get a log that tells me where it failed?  I tried the following, but it just gave me the same output that displays on the powershell screen.

Add-PSSnapin ShareFile

Try {

$sfClient = Get-SfClient –Name "C:\Users\Public\Documents\ShareFile\SFClient.sfps"

New-PSDrive -Name sfdrive -PSProvider ShareFile -Root "/" -Client $sfClient

Sync-SfItem -LocalPath "\\network\location\*" -Move -KeepFolders -Upload -ShareFilePath "/Network/Location" -Recursive -Overwrite

$_| Out-File C:\temp\logfile.txt

Remove-PSDrive sfdrive

The output in this log is:

Sync-SfItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 
characters, and the directory name must be less than 248 characters.
At C:\Users\Public\Documents\ShareFile\MarketingMove2.ps1:9 char:1
+ Sync-SfItem -LocalPath "\\Network\Location\Marketing\Jobs Active\X - JOBS AR ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Sync-SfItem], PathTooLongException
    + FullyQualifiedErrorId : System.IO.PathTooLongException,ShareFile.Api.Powershell.SyncSfItem
Photo of Eric


  • 7 Posts
  • 1 Reply Like

Posted 11 months ago

  • 1
Photo of Peter Ghrol

Peter Ghrol

  • 4 Posts
  • 0 Reply Likes
Long Path Tool is the best tool, you can use it.