From ac54f66741645315eea37d36bd8350cea2e16840 Mon Sep 17 00:00:00 2001 From: nitzmahone Date: Mon, 29 Feb 2016 16:30:55 -0800 Subject: [PATCH] don't lock file when calculating checksum --- lib/ansible/module_utils/powershell.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/powershell.ps1 b/lib/ansible/module_utils/powershell.ps1 index c150b07744..fc1d49f4ed 100644 --- a/lib/ansible/module_utils/powershell.ps1 +++ b/lib/ansible/module_utils/powershell.ps1 @@ -211,7 +211,7 @@ Function Get-FileChecksum($path) If (Test-Path -PathType Leaf $path) { $sp = new-object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider; - $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read); + $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read, [System.IO.FileShare]::ReadWrite); $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower(); $fp.Dispose(); }