Tomasz Kostrzewa 57cfb986dc modified: RdzeN-Profile.ps1
new file:   functions/Get-FileSize
	new file:   functions/Get-FileSize copy
	modified:   functions/prompt.ps1
2024-03-05 23:03:57 +01:00

24 lines
488 B
Plaintext

# gitea.RdzeN.net
#
# Get filesize.
function Get-FileSize {
param (
[string]$FilePath
)
$fileInfo = Get-Item $FilePath
$fileSizeBytes = $fileInfo.Length
$fileSizeKB = [math]::Round($fileSizeBytes / 1KB, 2)
$fileSizeMB = [math]::Round($fileSizeBytes / 1MB, 2)
$fileSizeGB = [math]::Round($fileSizeBytes / 1GB, 2)
return @{
"Bytes" = $fileSizeBytes
"KB" = $fileSizeKB
"MB" = $fileSizeMB
"GB" = $fileSizeGB
}
}