Copy-Item/Get-ChildItem Limitations

This topic contains 1 reply, has 2 voices, and was last updated by  Curtis Smith 2 years, 8 months ago.

  • Author
  • #30842


    Good Evening,

    I have started using robocopy.exe within my powershell scripts to get around the path limitation of Copy-Item and Get-ChildItem. I find it strange that even in Powershell v5 this issue still exists. I realise it is a limitation within Windows (for backward compatibility with older file systems) but I am certain there are ways to get around this – I think I read the win32 API can be used with prefixing the path with '\\?\' to get around this. I just wondered why the devs of Powershell haven't adopted this method – is there a technical reason that anyone is aware of?


  • #30843

    Curtis Smith

    It's not a limitation of Windows per say, it's a limitation of the .Net Framework which PowerShell is built on top of. Currently .Net does not support paths over 256 characters.

You must be logged in to reply to this topic.