Expand-Archive odd errors

Question:

I am trying to get at some data in an Autodesk Revit file, which is just a ZIP under the skin. I can use 7zip to extract but I am hoping to automate things with all native PS or Windows. I tried Expand-Archive after I renamed the RVT file to ZIP, but Expand-Archive has an odd error. The code is

And the error is

New-Object : Exception calling “.ctor” with “3” argument(s): “End of Central Directory record could not be found.”

Answer:

The file is corrupt. Re-download (or obtain) the ZIP file.

Background: I landed here having experienced the same error downloading a ZIP from Google Drive through a private link:

…then using the command:

The file downloaded but it wouldn’t extract. I downloaded through the browser using the UI, and then compared the download file sizes. Sure enough, the downloaded ZIP was corrupted. When I updated the URL to a Google Docs link directly to the file (that’s public with permission), the ZIP then downloaded and extracted correctly.

Hence, comments under the question alluding to the file being corrupt are correct.

Source:

Expand-Archive odd errors by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply