Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Instead of throwing "Path too long" error, Expand-Archive throws errors about removing non-existing items #69

Open
NReilingh opened this issue Mar 1, 2019 · 8 comments

Comments

@NReilingh
Copy link

When expanding an archive that contains long file paths to a location that also has a long path, the files to be expanded may have a resulting path that causes an error because it is too long.

When using "Expand All" from within Windows, this results in

Error 0x80010135: Path too long

The same should occur when running Expand-Archive in PowerShell, but what happens instead is that errors are thrown from Remove-Item on this line:

$expandedItems | % { Remove-Item $_ -Force -Recurse }

Remove-Item : Cannot find path {...} because it does not exist.

It appears that this line of code is meant to clean up after a failed expansion, but it is trying to remove items that it hasn't expanded yet, so this would indicate another issue.

@NicolasRouquette
Copy link

I am experiencing the same problem exactly; it is amazing that these windows 95 era path limitation problems are still around 20+ years later.

@NicolasRouquette
Copy link

FYI: There is a workaround for this issue: instead of using Expand-Archive, use 7-zip.
Following this suggestion worked in our environment: https://stackoverflow.com/a/58289112/1009693

Name                           Value                                                           
----                           -----                                                           
PSVersion                      5.1.14393.3866                                                  
PSEdition                      Desktop                                                         
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                         
BuildVersion                   10.0.14393.3866                                                 
CLRVersion                     4.0.30319.42000                                                 
WSManStackVersion              3.0                                                             
PSRemotingProtocolVersion      2.3                                                             
SerializationVersion           1.1.0.1   

@ayousuf23
Copy link
Contributor

We will reopen this issue if it is still persistent.

@paololazzari
Copy link

This issue still occurs

@BenjaminNiemann
Copy link

BenjaminNiemann commented Aug 11, 2023

Jep Chap can confirm. Still exists. Whats the reason behind .zip?
image

@paololazzari
Copy link

@ayousuf23 please reopen

@paololazzari
Copy link

@SydneyhSmith please reopen

@SydneyhSmith SydneyhSmith reopened this Aug 11, 2023
@Deondrede
Copy link

Ongoing issue for me please resolve

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants