# Read contents of Zip file and extract the metadata from the files inside the Zip

**URL:** <https://forums.powershell.org/t/read-contents-of-zip-file-and-extract-the-metadata-from-the-files-inside-the-zip/14220>\
**Category:** PowerShell Help\
**Created:** [April 22, 2020, 10:10am UTC](https://forums.powershell.org/t/read-contents-of-zip-file-and-extract-the-metadata-from-the-files-inside-the-zip/14220 "2020-04-22T10:10:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pb10f1](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pb10f1](https://forums.powershell.org/u/pb10f1)\
**Post date:** [April 22, 2020, 10:10am UTC](https://forums.powershell.org/t/read-contents-of-zip-file-and-extract-the-metadata-from-the-files-inside-the-zip/14220/1 "2020-04-22T10:10:35Z")

</div>

Hi

I have a requirement for the following…

Read contents of Zip file and extract the metadata from the files inside the Zip and output the results to a csv file.

The csv needs to also include the name of the zip for each file so it can be traced back.

[https://mickitblog.blogspot.com/2016/07/powershell-retrieving-file-details.html](https://mickitblog.blogspot.com/2016/07/powershell-retrieving-file-details.html) –\> provides getting the metadata from a file.

What i’m not sure about is:

1. Do i need to extract the zip contents to a temp location
2. Read the metadata & output to the CSV
3. Delete the temp location
4. Do the next file

or is there a way to get the info from with in the files in the zip.

I have been told that there is over 10,000 zip files.

Thanks

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [April 22, 2020, 2:06pm UTC](https://forums.powershell.org/t/read-contents-of-zip-file-and-extract-the-metadata-from-the-files-inside-the-zip/14220/2 "2020-04-22T14:06:33Z")

</div>

Paul, welcome to [Powershell.org](http://Powershell.org). Please take a moment and read the very first post on top of the list of this forum: [Read Me Before Posting! You’ll be Glad You Did!](https://powershell.org/forums/topic/read-me-before-posting-youll-be-glad-you-did).

This forum is for scripting questions rather than script requests. We do not write customized and ready to use scripts or solutions on request.

As far as I know there is no built in way to extract the metadata without extracting the files itself. You might consider using a third party tool like [7zip](https://www.7-zip.org). The included CLI probably extracts the metadata much faster than just with the built in functions.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/read-contents-of-zip-file-and-extract-the-metadata-from-the-files-inside-the-zip/14220/3 "2024-05-16T20:30:11Z")

</div>


