Get-ChildItem : The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.

The only way is to shorten the path. PowerShell does not have support for long paths.

Long Paths on a server are a very bad thing as they will continue to be headaches for all.

You can shorten the path by mapping a PowerShell drive at a midway point.

New-PSDrive -Name X -PSProvider FileSystem -Root \\server\share\folder1\folder2\folder3

Now you can use X: to access the shorter path.

The mapping will be removed when you exit PowerShell






Leave a Reply

Your email address will not be published. Required fields are marked *