I have the below line in my powershell script in windows 7
$subFolderItems = Get-ChildItem $i.FullName -recurse -force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -property Length -sum | Select-Object Sum
The problem I get this error The specified path, file name, or both are too long in some of the files.
I looked into it and found some suggestions to add \\?\ before the file path I tried as below and it's not working any advice?
$Base = '\\?\'
$subFolderItems = Get-ChildItem $Base$i.FullName -recurse -force | Where-Object {$_.PSIsContainer -eq $false} | Measure-Object -property Length -sum | Select-Object Sum
LongPathsEnabledor enabling in group policy$Base$i.FullName-->($Base + $i.FullName)