Expected to live in a parent directory and then operate on files in child directories
PS C:\Releases> .\md5.ps1 .\App_v1\CompiledPackage.zip
$pathToFile = $args[0].Substring(1) | |
$where = Get-Location | |
Function md5Hash($filePath) | |
{ | |
$someFilePath = $filePath | |
$md5 = new-object -TypeName System.Security.Cryptography.MD5CryptoServiceProvider | |
$hash = [System.BitConverter]::ToString($md5.ComputeHash([System.IO.File]::ReadAllBytes($someFilePath))) | |
return $hash | |
} | |
Write-Host (md5Hash $where$pathToFile) |