Added try and catch

This commit is contained in:
Markus Fleschutz
2020-10-05 13:12:12 +02:00
parent 14ab054646
commit 847be37772
25 changed files with 199 additions and 110 deletions

View File

@ -7,6 +7,10 @@
# License: CC0
param([string]$File)
$Result = get-filehash $File -algorithm SHA1
write-host $Result.Hash
exit 0
try {
$Result = get-filehash $File -algorithm SHA1
write-host $Result.Hash
exit 0
} catch { Write-Error $Error[0] }
exit 1