get-childitem Error: The specified path, file name, too long changing the acl.

Hello,

Did you ever had the issue get-childitem : The specified path, file name, or both are too long when you are changing the acl of some files?

I just had… Some users are putting the whole life in name of the file! WHY???!!!!

Normally you whould think you can fix this with get-childitem like this:

In the end you will receive the message: get-childitem : The specified path, file name, or both are too long.
You cannot fix this with a New-PSDrive because $folder.fullname overrules the path of the psdrive!

After some testing and searching I found the solution!

I hope this will help you setting the acl of your files and folders in PowerShell.

About the Author

Sander

No Comments

Comments are closed.