From a06182f5d0b3b721cf332ab698602d6dea90216c Mon Sep 17 00:00:00 2001 From: Lee Burton Date: Wed, 23 Nov 2016 23:50:01 -0800 Subject: [PATCH] add simple powersell paste function and example --- about.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/about.md b/about.md index 69103d5..fd2291c 100644 --- a/about.md +++ b/about.md @@ -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.