Adds support for PS 4.0 native hash command to remove a dependency

PS 4.0 requires installing WMF 4.0 on windows 7, 8, Server 2012
Native on 8.1, Server 2012r2
This commit is contained in:
Jack Bennett 2015-03-18 13:50:00 +00:00
parent 3c289b455b
commit aad729eb87

View File

@ -54,6 +54,10 @@ function Flatten-Directory ($name) {
}
function Digest-MD5 ($path) {
if(Get-Command Get-FileHash -ErrorAction SilentlyContinue){
return (Get-FileHash -Algorithm MD5 -Path $path).Hash
}
return Invoke-Expression "md5sum $path"
}