Added MD5.ps1 and SHA1.ps1

This commit is contained in:
Markus Fleschutz 2020-06-15 16:26:03 +02:00
parent 91073e4cc4
commit 444abea634
3 changed files with 27 additions and 4 deletions

12
Scripts/MD5.ps1 Normal file
View File

@ -0,0 +1,12 @@
#!/snap/bin/powershell
#
# Syntax: MD5.ps1 <file>
# Description: prints the MD5 checksum of the given file
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
#
param([string]$File)
$Result = get-filehash $File -algorithm MD5
write-host $Result.Hash
exit 0

12
Scripts/SHA1.ps1 Normal file
View File

@ -0,0 +1,12 @@
#!/snap/bin/powershell
#
# Syntax: SHA1.ps1 <file>
# Description: prints the SHA1 checksum of the given file
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
#
param([string]$File)
$Result = get-filehash $File -algorithm SHA1
write-host $Result.Hash
exit 0

View File

@ -1,13 +1,12 @@
#!/snap/bin/powershell
#
# Syntax: SHA256.ps1 <file>
# Description: prints the SHA256 checksum of the given file
# Author: Markus Fleschutz
# Source: github.com/fleschutz/PowerShell
# License: CC0
#
param(
[string]$File)
$Result = get-filehash $File
param([string]$File)
$Result = get-filehash $File -algorithm SHA256
write-host $Result.Hash
exit 0