# code from http://aperturescience.su
Function Get-FileHash
{
[CMDLetBinding()]
param
(
[Parameter(mandatory=$true, valuefrompipeline=$true)] [ValidateScript({Test-Path $_ -PathType \'lea\'})] [String] $File,
[ValidateSet("sha1", "sha256", "sha384", "sha512", "md5", "ripemd160")] $HashAlgorithm = "sha256",
[switch] $Group
)
Process
{
#variable to store hash of the file
$hash
# code from http://aperturescience.su