From 2e60425b714803fae5e900c335a00b3f45421ff5 Mon Sep 17 00:00:00 2001 From: Jon Hawkesworth Date: Mon, 24 Nov 2014 17:52:05 +0000 Subject: [PATCH] Adding first pass at win_copy, win_file and win_template modules. --- windows/win_stat.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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; }