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

Welcome Forums General PowerShell Q&A Read contents of Zip file and extract the metadata from the files inside the Zip

  • This topic has 1 reply, 2 voices, and was last updated 1 month ago by
    Participant
    .
Viewing 1 reply thread
  • Author
    Posts
    • #221454
      Participant
      Topics: 1
      Replies: 0
      Points: 11
      Rank: Member

      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 –> 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

    • #221484
      Participant
      Topics: 4
      Replies: 2231
      Points: 5,414
      Helping Hand
      Rank: Community MVP

      Paul, welcome to 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!.

      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. The included CLI probably extracts the metadata much faster than just with the built in functions.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.