Adding first pass at win_copy, win_file and win_template modules.

This commit is contained in:
Jon Hawkesworth 2014-11-24 17:52:05 +00:00
parent e396611206
commit 2e60425b71

View file

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