move get-content into try, silence errors

This commit is contained in:
Asif Bacchus 2020-06-20 07:31:59 -06:00
parent 5c6c09b24f
commit 8a04d654ef
1 changed files with 1 additions and 0 deletions

View File

@ -46,6 +46,7 @@ function hashSHA($type){
function doHash($file, $hash){
$fileContents = Get-Content $file -Raw
$fileContents = Get-Content $file -Raw -ErrorAction SilentlyContinue
try {
$hashBytes = $hash.ComputeHash([System.Text.Encoding]::UTF8.GetBytes($fileContents))
return [System.Convert]::ToBase64String($hashBytes)