don't lock file when calculating checksum

pull/15204/head
nitzmahone 9 years ago committed by James Cammarata
parent 3a91a4321e
commit a74e97fa31

@ -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();
}

Loading…
Cancel
Save