forked from MultiPoolMiner/MultiPoolMiner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCreate-BinaryHashes.ps1
More file actions
21 lines (15 loc) · 864 Bytes
/
Create-BinaryHashes.ps1
File metadata and controls
21 lines (15 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# This script is for developers when updating miner binaries
# binaryhashes.txt contains the SHA256 hash of every executable file in the Bin directory
# which is used to check that the correct version of the miners is installed.
# This script will regenerate the binaryhashes.txt file to match what is currently installed on your system
If (-not (Test-Path ".\Bin")) {
Write-Error "Bin directory does not exist!"
}
# Get list of all the exe files with relative paths, sort to minimize differences when updating git
$Binaries = Get-ChildItem -Path Bin -Recurse -Filter "*.exe" | Resolve-Path -Relative | Sort-Object
$Hashes = [PSCustomObject]@{}
$Binaries | Foreach-Object {
$Hashes | Add-Member $_ (Get-FileHash $_).Hash
}
$Hashes | ConvertTo-Json | Out-File -FilePath "binaryhashes.txt" -Encoding ASCII
Write-Host "Hashes for binary files updated!"