Vol*_*ets 8 powershell compression attributes windows-server-2003-r2
无论 Windows Server 2003 机器上的文件格式如何,我都需要找到所有压缩文件/文件夹。搜索选项不提供此功能。
有没有办法列出/查看所有压缩文件?
也许,这可以通过 PowerShell 使用文件/文件夹属性来完成,并将其放入具有文件位置的 txt 文件中。
更新:
在压缩文件/文件夹下 - 我的意思是更改文件/文件夹属性后在资源管理器中以蓝色显示的文件。
Cla*_*ton 10
压缩后的指标存储在“属性”属性中。此 Powershell 将报告压缩文件。
gci -r C:\search\path | where {$_.attributes -match "compressed"} | foreach { $_.fullname }
Run Code Online (Sandbox Code Playgroud)
-- 开始编辑
文件大小存储在长度属性中,以字节为单位。您可以使用所谓的“计算属性”来以 kb、mb、gb 等为单位显示大小。
$col1 = @{label="Size";Expression={$_.length/1mb};FormatString="0.0";alignment="right"}
$col2 = @{label="Fullname";Expression={$_.fullname};alignment="left"}
gci -r | where {$_.attributes -match "compressed"} | ft $col1,$col2 -autosize
Run Code Online (Sandbox Code Playgroud)
如果您只想要更大的文件,请说大于 1MB
gci -r | where {$_.attributes -match "compressed" -AND $_.length -gt 1mb} | ft $col1,$col2 -autosize
Run Code Online (Sandbox Code Playgroud)
文件夹大小也是可能的,稍微不同的野兽。只需尝试在 google 上搜索“powershell 文件夹大小”很多关于如何做到这一点的帖子。还有许多免费工具 (windirstat) 可以报告文件夹大小。
归档时间: |
|
查看次数: |
10865 次 |
最近记录: |