Copy-Item/Get-ChildItem Limitations

Welcome Forums General PowerShell Q&A Copy-Item/Get-ChildItem Limitations

This topic contains 1 reply, has 2 voices, and was last updated by

 
Participant
3 years, 2 months ago.

  • Author
    Posts
  • #30842

    Participant
    Points: 13
    Rank: Member

    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?

    Thanks.

  • #30843

    Participant
    Points: 0
    Rank: Member

    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.

The topic ‘Copy-Item/Get-ChildItem Limitations’ is closed to new replies.