Bugfix: win_checksum.ps1

This commit is contained in:
Trond Hindenes 2015-06-16 14:20:34 +00:00
commit daee298cb6

View file

@ -151,7 +151,7 @@ Function Get-FileChecksum($path)
{ {
$sp = new-object -TypeName System.Security.Cryptography.SHA1CryptoServiceProvider; $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.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower(); $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower();
$fp.Dispose(); $fp.Dispose();
} }
ElseIf (Test-Path -PathType Container $path) ElseIf (Test-Path -PathType Container $path)