Skip to content

Instantly share code, notes, and snippets.

@jfmherokiller
Created May 31, 2017 20:46
Show Gist options
  • Save jfmherokiller/be3ed5feed5eb3ac999d15f6da951cba to your computer and use it in GitHub Desktop.
Save jfmherokiller/be3ed5feed5eb3ac999d15f6da951cba to your computer and use it in GitHub Desktop.
http2ipfs
Param(
[Parameter(Mandatory=$true,ValueFromPipeline=$true)]
[string]$URL
)
$tempfile = New-TemporaryFile
& wget.exe -q --user-agent="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36" --output-document=$tempfile $URL
$filehash = (ipfs add --pin=false -Q "$tempfile")
Remove-Item $tempfile
Write-Host "###############"
Write-Host "## DDOWNLOAD COMPLETE"
Write-Host "##"
Write-Host "## Urls:"
Write-Host "## http://localhost:8080/ipfs/$filehash"
Write-Host "## https://ipfs.io/ipfs/$filehash"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment