Snippets Collections
$filename = 'D:\PS\CSV\PowerShell-EventLogs.csv'    

# Get file size in bytes
(Get-Item -Path $filename).Length

# get file size in KB in PowerShell
(Get-Item -Path $filename).Length/1KB

# get file size in MB in PowerShell   
(Get-Item -Path $filename).Length/1MB

# get file size in GB in PowerShell
(Get-Item -Path $filename).Length/1GB  
star

Mon Oct 31 2022 02:56:23 GMT+0000 (UTC) https://shellgeek.com/powershell-get-file-size/

#powershell #file #filesystem #measure

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension