📜  获取文件powershell的大小 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:21.250000             🧑  作者: Mango

代码示例1
To get the file sizes in KB:

Get-ChildItem | % {[int]($_.length / 1kb)}
Or to round up to the nearest KB:

Get-ChildItem | % {[math]::ceiling($_.length / 1kb)}
To get the number characters:

Get-ChildItem | % {(Get-Content $_.FullName).length}

credit to Dave Sexton from Stack Overflow