I need to modify my script to catch output or get past the Max_Path of 248 character limit in a folder path, and will need to dump the catch into a text file .
Here is what I have so far and works great if it is under 248 path length.
get-childitem J:\Lab -recurse | where {$_.PSiscontainer -eq $true} | select FullName, length | foreach {
if ($_.FullName.length -gt 245 ){ Write-Host $_.FullName.Length, $_.FullName
}
}