mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 09:04:18 +01:00
Update publish-to-ipfs.ps1
This commit is contained in:
parent
a5ee42192a
commit
9872ba3b16
@ -19,22 +19,20 @@ try {
|
||||
$StopWatch = [system.diagnostics.stopwatch]::startNew()
|
||||
|
||||
""
|
||||
"Step 1/3: Searching for IPFS executable..."
|
||||
"Step 1/3: Searching for IPFS..."
|
||||
& ipfs --version
|
||||
if ($lastExitCode -ne "0") { throw "Can't execute 'ipfs' - make sure IPFS is installed and available" }
|
||||
|
||||
if (test-path "$Files" -pathType container) {
|
||||
""
|
||||
"Step 2/3: Publishing folder $Files/ to IPFS..."
|
||||
[int]$Count = 1
|
||||
& ipfs add -r "$Files" > $HashList
|
||||
|
||||
[int]$Count = 1
|
||||
""
|
||||
echo "Step 3/3: Calculating digital forensics hashes to $DF_HASHES ..."
|
||||
& nice hashdeep -c md5,sha1,sha256 -r -d -l -j 1 "$Files" > $DF_Hashes
|
||||
} else {
|
||||
$FileList = (get-childItem "$Files")
|
||||
[int]$Count = $FileList.Count
|
||||
foreach ($File in $FileList) {
|
||||
if (test-path "$Files" -pathType container) {
|
||||
"Step 2/3: Publishing folder $File/ to IPFS..."
|
||||
@ -44,6 +42,7 @@ try {
|
||||
& ipfs add "$File" >> $HashList
|
||||
}
|
||||
}
|
||||
[int]$Count = $FileList.Count
|
||||
}
|
||||
|
||||
[int]$Elapsed = $StopWatch.Elapsed.TotalSeconds
|
||||
|
Loading…
Reference in New Issue
Block a user