Sample code for 30+ languages & platforms
PowerShell

List Files in a .zip

See more Zip Examples

How to list files within a .zip

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$success = $false

# This example requires the Chilkat API to have been previously unlocked.
# See Global Unlock Sample for sample code.

$zip = New-Object Chilkat.Zip

$success = $zip.OpenZip("a.zip")
if ($success -eq $false) {
    $($zip.LastErrorText)
    exit
}

# Get the number of files and directories in the .zip
$n = $zip.NumEntries

$entry = New-Object Chilkat.ZipEntry

$i = 0

while ($i -lt $n) {
    $zip.EntryAt($i,$entry)
    if ($entry.IsDirectory -eq $false) {
        # (the filename may include a path)
        $($entry.FileName)
    }

    $i = $i + 1
}