The Old New Thing - Little-known command line utility: clip
“Windows Vista includes a tiny command line utility called
clip
. All it does is paste its stdin onto the clipboard.dir clip
echo hey clip…”
So much that I don’t know…sigh (TG cause otherwise this job would get SO boring ;)
This is a pretty cool Windows Vista/Win7 (and probably post Vista server OS’s too) utility that pipes into the clipboard. If you’ve ever redirected/piped a command line utility into a text file just so you could then easily cut-n-paste from it, then this utility is just for you (been there, done that, got the T-shirt)
So since I’m on a PowerShell kick, I did a quick 5 second search for doing something similar in PS and it’s not quite so easy (kind of, sort of).
Since PS has the power of .Net behind it, you can use .Net’s clipboard goodness to make it happen, Windows PowerShell Blog - Copy console screen to system clipboard. Yet if you look at that code in the post you’ll see it’s not really all the pretty. Not hard, yet not as easy as the clip utility or some kind of more integrated solution.
A much prettier solution is the PowerShell Community Extensions (PSCX) Out-clipboard, shown here, The Endeavour - Manipulating the clipboard with PowerShell
And of course, clip can just be used from PS too… ;)
Related Past Post XRef:
PowerShell Community Extensions V1.1.1 Released
No comments:
Post a Comment
NOTE: Anonymous Commenting has been turned off for a while... The comment spammers are just killing me...
ALL comments are moderated. I will review every comment before it will appear on the blog.
Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...
I reserve, and will use, the right to not approve ANY comment for ANY reason. I will not usually, but if it's off topic, spam (or even close to spam-like), inflammatory, mean, etc, etc, well... then...
Please see my comment policy for more information if you are interested.
Thanks,
Greg
PS. I am proactively moderating comments. Your comment WILL NOT APPEAR UNTIL I approve it. This may take some hours...