-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashcheck.ps1
More file actions
27 lines (23 loc) · 1.07 KB
/
hashcheck.ps1
File metadata and controls
27 lines (23 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<#
Generates multiple hashes of an input file
#>
param(
[Parameter(Mandatory=$true)][string]$TargetFile
)
$md5 = Get-FileHash $TargetFile -Algorithm MD5 | select -ExpandProperty hash
$sha1 = Get-FileHash $TargetFile -Algorithm SHA1 | select -ExpandProperty hash
$sha2 = Get-FileHash $TargetFile -Algorithm SHA256 | select -ExpandProperty hash
$ripemd = Get-FileHash $TargetFile -Algorithm RIPEMD160 | select -ExpandProperty hash
Add-Content filehashes.txt "--------------------------------------------------------------------------"
Add-Content filehashes.txt "File Hashes Generated for $TargetFile"
Add-Content filehashes.txt "MD5 Hash : $md5"
Add-Content filehashes.txt "SHA1 Hash : $sha1"
Add-Content filehashes.txt "SHA256 Hash : $sha2"
Add-Content filehashes.txt "RIPEMD160 Hash : $ripemd"
Add-Content filehashes.txt "--------------------------------------------------------------------------"
Clear-Host
Write-Host "MD5 Hash: $md5"
Write-Host "SHA1 Hash: $sha1"
Write-Host "SHA256 Hash: $sha2"
Write-Host "RIPEMD160 Hash: $ripemd"
Write-Host "Hashes stored in filehashes.txt"