mirror of
https://git.ecdf.ed.ac.uk/win_automation/windows-ansible.git
synced 2026-10-26 13:47:21 +00:00
swap to int64 to prevent error on large files.
This commit is contained in:
1 parent
c81217f99c
commit
894f93c645
2 files changed
+2
-2
No files matched your search
@@ -47,7 +47,7 @@ $Directoryex | ForEach {
|
|||||||
|
|
||||||
|
|
||||||
Function Format-FileSize() {
|
Function Format-FileSize() {
|
||||||
Param ([int]$sizeex)
|
Param ([int64]$sizeex)
|
||||||
If ($sizeex -gt 1TB) {[string]::Format("{0:0.00} TB", $sizeex / 1TB)}
|
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 1GB) {[string]::Format("{0:0.00} GB", $sizeex / 1GB)}
|
||||||
ElseIf ($sizeex -gt 1MB) {[string]::Format("{0:0.00} MB", $sizeex / 1MB)}
|
ElseIf ($sizeex -gt 1MB) {[string]::Format("{0:0.00} MB", $sizeex / 1MB)}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ Get-ChildItem -Path $Directory -Recurse -Force -File -Exclude ".*" | ForEach {
|
|||||||
|
|
||||||
#Change permissions
|
#Change permissions
|
||||||
Function Format-FileSize() {
|
Function Format-FileSize() {
|
||||||
Param ([int]$size)
|
Param ([int64]$size)
|
||||||
If ($size -gt 1TB) {[string]::Format("{0:0.00} TB", $size / 1TB)}
|
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 1GB) {[string]::Format("{0:0.00} GB", $size / 1GB)}
|
||||||
ElseIf ($size -gt 1MB) {[string]::Format("{0:0.00} MB", $size / 1MB)}
|
ElseIf ($size -gt 1MB) {[string]::Format("{0:0.00} MB", $size / 1MB)}
|
||||||
|
|||||||
Reference in new issue
Block a user