Answers for "get size of file powershell"


get size of file powershell

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
Posted by: Guest on June-04-2021

Browse Popular Code Answers by Language