Search a file share. Filepath is to long and no count


hi guys,

please have @ code. it  works fine normal directories on fileshare gives error filepath long.

and need of files pops up. when use count option don't list.

when use each object count not give me output in file. can me bit on this.

maybe change "system.io"?

$systems = 'd:\temp\serverlist.txt' $output = 'd:\temp\result.txt'   foreach ($system in (get-content $systems))  {       invoke-command -computername $system -scriptblock  {       get-psdrive -p "filesystem" ` |     % {                     get-childitem $_.root -include *financial* -recurse  | sort-object length -descending                     }   }  | out-file $output } 

kind regards,


here how find files long.

get-childitem \system\share -rec -ev longpaths -ea 0 | out-null
$longpaths|select targetobject


¯\_(ツ)_/¯



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Azure MFA with Azure AD and RDS

Failed to setup initiator portal. Error status is given in the dump data.

Invalid pointer on gpresult /h gpreport.html