summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2021-02-06 04:40:41 +1000
committerGitHub <noreply@github.com>2021-02-05 12:40:41 -0600
commit8e5aab4d76896b4dcf735a626c281ddcb7b2d211 (patch)
treeb2ab2d47e5dd76c20e44963b2352c812348473c5
parent6f4ea2f19e25847ef44de543f6f5d83d701a3c34 (diff)
downloadansible-8e5aab4d76896b4dcf735a626c281ddcb7b2d211.tar.gz
Support large folder size comparisons for win_find (#58466) (#73382)
Changed [int] to [int64] to support larger folders. Otherwise module fails as soon as a large folder is encountered. (cherry picked from commit 8def67939dbd5dbba84fe160f3ad187c76ebe63a) Co-authored-by: joshinryz <josh.robinett@gmail.com>
-rw-r--r--changelogs/fragments/58466-FIX_win_find-Bug-Get-FileStat_fails_on_large_files.yml2
-rw-r--r--lib/ansible/modules/windows/win_find.ps12
2 files changed, 3 insertions, 1 deletions
diff --git a/changelogs/fragments/58466-FIX_win_find-Bug-Get-FileStat_fails_on_large_files.yml b/changelogs/fragments/58466-FIX_win_find-Bug-Get-FileStat_fails_on_large_files.yml
new file mode 100644
index 0000000000..8b40976a93
--- /dev/null
+++ b/changelogs/fragments/58466-FIX_win_find-Bug-Get-FileStat_fails_on_large_files.yml
@@ -0,0 +1,2 @@
+bugfixes:
+ - "win_find - Get-FileStat used [int] instead of [int64] for file size calculations"
diff --git a/lib/ansible/modules/windows/win_find.ps1 b/lib/ansible/modules/windows/win_find.ps1
index 8857692033..d7f6652e1c 100644
--- a/lib/ansible/modules/windows/win_find.ps1
+++ b/lib/ansible/modules/windows/win_find.ps1
@@ -177,7 +177,7 @@ Function Assert-Size($info) {
$size_pattern = '^(-?\d+)(b|k|m|g|t)?$'
$match = $size -match $size_pattern
if ($match) {
- [int]$specified_size = $matches[1]
+ [int64]$specified_size = $matches[1]
if ($null -eq $matches[2]) {
$chosen_byte = 'b'
} else {