add simple powersell paste function and example

This commit is contained in:
Lee Burton 2016-11-23 23:50:01 -08:00
parent eb5c8eef6a
commit a06182f5d0
1 changed files with 3 additions and 0 deletions

View File

@ -27,6 +27,9 @@ URL with:
* osx: `cat something | haste | pbcopy`
* linux: `cat something | haste | xsel`
* windows: check out [WinHaste](https://github.com/ajryan/WinHaste)
* or in PowerShell
``` function haste { param($serviceurl = "http://hastebin.com",$paste); if(!$paste){$paste=@($input)}; $r=Invoke-RestMethod -Method Post -UseBasicParsing -Uri "$serviceurl/documents" -Body ($paste -join "`n");"$($serviceurl)/$($r.key)"}```
followed by `cat something | haste | clip`
After running that, the STDOUT output of `cat something` will show up at a URL
which has been conveniently copied to your clipboard.