diff --git a/windows/win_stat.ps1 b/windows/win_stat.ps1 index 4e4c55b2aa3..928b779b488 100644 --- a/windows/win_stat.ps1 +++ b/windows/win_stat.ps1 @@ -53,10 +53,7 @@ Else If ($get_md5 -and $result.stat.exists -and -not $result.stat.isdir) { - $sp = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider; - $fp = [System.IO.File]::Open($path, [System.IO.Filemode]::Open, [System.IO.FileAccess]::Read); - $hash = [System.BitConverter]::ToString($sp.ComputeHash($fp)).Replace("-", "").ToLower(); - $fp.Dispose(); + $hash = Get-FileMd5($path); Set-Attr $result.stat "md5" $hash; }