mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-09 21:07:40 +02:00
Update start-ipfs-server.ps1 and publish-to-ipfs.ps1
This commit is contained in:
@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user