From aad729eb87725c3fcf1ca5a05e50ef415e02a64c Mon Sep 17 00:00:00 2001 From: Jack Bennett Date: Wed, 18 Mar 2015 13:50:00 +0000 Subject: [PATCH] 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 --- scripts/utils.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/utils.ps1 b/scripts/utils.ps1 index f8a0f44..e914c04 100644 --- a/scripts/utils.ps1 +++ b/scripts/utils.ps1 @@ -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" }