First version of this function, feel free to post requests or questions in the Q&A section. I think there is more to be done with this, let me know what you think of it and how you are utilizing this.

Updated 05-10-2012:

- Slight performance improvement by removing $TempPSObject

- Added parameter validation

Updated 29-12-2012:

- Improved pipeline support

- The -FolderPath parameter can now take an array as input

Updated 15-04-2013

- Added /r:0 /w:0 parameters to prevent timeouts when file is in use

Version 1.1 - Updated 28-08-2013

PowerShell
Edit|Remove
.SYNOPSIS    
    Function to get file and folder names with long paths. 
 
.DESCRIPTION 
    This function requires Robocopy to be installed. Robocopy is used to recursively search through 
    a folder structure to find file or folder names that have more than a certain number of characters. 
    The function returns an object with three properties: FullPath,Type and FullPath. 
 
.PARAMETER FolderPath  
    The path or paths which will be scanned for long path names 
 
.PARAMETER MaxDepth 
    Specifies the maximum depth for files and folders in a folder structure 
 
.NOTES    
    Name: Get-LongPathName.ps1 
    Version: 1.1 
    Author: Jaap Brasser 
    DateCreated: 2012-10-05 
    DateUpdated: 2013-08-28 
    Site: http://www.jaapbrasser.com 
 
.LINK 
    http://www.jaapbrasser.com 
 
.EXAMPLE 
    Get-LongPathName -FolderPath 'C:\Program Files' 
     
.EXAMPLE 
    "c:\test","C:\Deeppathtest" | Get-LongPathName -FolderPath $_ -MaxDepth 200 | ft PathLength,Type,FullPath -AutoSize