Created
May 31, 2017 20:46
-
-
Save jfmherokiller/be3ed5feed5eb3ac999d15f6da951cba to your computer and use it in GitHub Desktop.
http2ipfs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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