swap to int64 to prevent error on large files.

This commit is contained in:
abrown38 committed 2025-02-11 10:08:35 +00:00
1 parent c81217f99c
commit 894f93c645
2 files changed
+4 -4

No files matched your search

@@ -47,11 +47,11 @@ $Directoryex | ForEach {
Function Format-FileSize() {
Param ([int]$sizeex)
Param ([int64]$sizeex)
If ($sizeex -gt 1TB) {[string]::Format("{0:0.00} TB", $sizeex / 1TB)}
ElseIf ($sizeex -gt 1GB) {[string]::Format("{0:0.00} GB", $sizeex / 1GB)}
ElseIf ($sizeex -gt 1MB) {[string]::Format("{0:0.00} MB", $sizeex / 1MB)}
ElseIf ($sizeex -gt 1KB) {[string]::Format("{0:0.00} kB", $sizeex / 1KB)}
ElseIf ($sizeex -gt 0) {[string]::Format("{0:0.00} B", $sizeex)}
Else {""}
}
}
@@ -24,7 +24,7 @@ Get-ChildItem -Path $Directory -Recurse -Force -File -Exclude ".*" | ForEach {
#Change permissions
Function Format-FileSize() {
Param ([int]$size)
Param ([int64]$size)
If ($size -gt 1TB) {[string]::Format("{0:0.00} TB", $size / 1TB)}
ElseIf ($size -gt 1GB) {[string]::Format("{0:0.00} GB", $size / 1GB)}
ElseIf ($size -gt 1MB) {[string]::Format("{0:0.00} MB", $size / 1MB)}
@@ -35,4 +35,4 @@ Else {""}
}
}