ShareFile-PowerShell icon indicating copy to clipboard operation
ShareFile-PowerShell copied to clipboard

Help with identifying "paths" > 256 chars

Open cj-donovan opened this issue 5 years ago • 2 comments

Hoping one or more of you might be able to assist. We're trying to do an urgent move from Sharefile to Sharepoint/Onedrive and we're striking the file path limit in some home directories. We need a means to identify the file/folder combinations that are going to fail in transfer. Any help gratefully accepted. Cheers

cj-donovan avatar Apr 06 '20 04:04 cj-donovan

Output Recursive directory listing to file with Dir /s > output.txt Throw that in excel. Add a new column, Use the LEN function to count characters for each line

unashamed avatar Apr 06 '20 04:04 unashamed

Thank you unashamed! You set me on the right path - see what I did there? - :-)

Set-Location "S:\Shared Folders\person@domain"

Get-ChildItem -Recurse | % { $_.FullName } | out-file c:\temp\files.txt

$textfile = 'C:\Temp\files.txt' $headerfile = 'C:\Temp\header.txt' $(Get-Content $headerfile; Get-Content $textfile) | Set-Content $textfile

import-csv C:\temp\files.txt | foreach{ $file = $_.Filenames | Out-String if ($file.Length -gt 160){ write-host -nonewline $file.Length "-" $file } }

cj-donovan avatar Apr 06 '20 22:04 cj-donovan