我编辑了这篇文章以删除所有代码。
答案 0 :(得分:1)
您可以使用以下cmdlet
获取Zip文件夹的内容$ZipFile="Path"
$AllFile=Get-ChildItem $ZipFile -Recurse -Filter '*.zip'
$ObjArray = @()
foreach ($item in $AllFile){
$FullName=$item.FullName
$RawFiles = [IO.Compression.ZipFile]::OpenRead($FullName).Entries
$FullPathName=$FullName+"\"+"$RawFile"
foreach($RawFile in $RawFiles) {
$object = New-Object -TypeName PSObject
$Object | Add-Member -MemberType NoteProperty -Name FileName -Value $RawFile.Name
$Object | Add-Member -MemberType NoteProperty -Name FullPath -Value $FullPathName
$Object | Add-Member -MemberType NoteProperty -Name CompressedLengthInKB -Value ($RawFile.CompressedLength/1KB).Tostring("00")
$Object | Add-Member -MemberType NoteProperty -Name UnCompressedLengthInKB -Value ($RawFile.Length/1KB).Tostring("00")
$Object | Add-Member -MemberType NoteProperty -Name FileExtn -Value ([System.IO.Path]::GetExtension($RawFile.FullName))
$Object | Add-Member -MemberType NoteProperty -Name ZipFileName -Value $zipfile
$ObjArray += $Object
}
}
在运行上述cmdlet之前,请确保已安装dot net 4.5。