更新时间:2023-12-04 21:18:52
如果可以使用 7z.exe
,您也许可以执行以下操作:
If you can use 7z.exe
, you may be able to do something like this:
& 'C:\Program Files\7-Zip\7z.exe' l <zipfilename> |
Select-Object -Last 1 |
Select-String '([0-9]+) files, ([0-9]+) folders' |
ForEach-Object {
$fileCount = [Int] $_.Matches[0].Groups[1].Value
$dirCount = [Int] $_.Matches[0].Groups[2].Value
}