更新时间:2023-12-04 21:10:58
如果你可以使用 7z.exe
,你或许可以这样做:
If you can use 7z.exe
, you may be able to do something like this:
& 'C:Program Files7-Zip7z.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
}