Update start-ipfs-server.ps1 and publish-to-ipfs.ps1

This commit is contained in:
Markus Fleschutz
2022-10-29 18:37:41 +02:00
parent 2de3ecc59c
commit b5d19fdde2
2 changed files with 10 additions and 13 deletions

View File

@ -24,26 +24,25 @@ try {
$StopWatch = [system.diagnostics.stopwatch]::startNew()
"Step 1/3: Searching for IPFS executable..."
Write-Host "(1/3) Searching for IPFS executable..." -NoNewline
& ipfs --version
if ($lastExitCode -ne "0") { throw "Can't execute 'ipfs' - make sure IPFS is installed and available" }
if (test-path "$FilePattern" -pathType container) {
""
"⏳ Step 2/3: Publishing folder $FilePattern/..."
"⏳ (2/3) Publishing folder $FilePattern/..."
& ipfs add -r "$FilePattern" > $HashList
[int]$Count = 1
""
"Step 3/3: Calculating digital forensics hashes to $DF_HASHES ..."
"(3/3) Calculating digital forensics hashes to $DF_HASHES ..."
& nice hashdeep -c md5,sha1,sha256 -r -d -l -j 1 "$FilePattern" > $DF_Hashes
} else {
$FileList = (get-childItem "$FilePattern")
foreach ($File in $FileList) {
if (test-path "$FilePattern" -pathType container) {
"Step 2/3: Publishing folder $File/..."
"(2/3) Publishing folder $File/..."
& ipfs add -r "$File" >> $HashList
} else {
"Step 3/3: Publishing file $File..."
"(3/3) Publishing file $File..."
& ipfs add "$File" >> $HashList
}
}