Sending Text to the Clipboard

by Jan 3, 2012

Wouldn't it be fun if you could send results directly to the clipboard? Well, beginning with Windows Vista you can – thanks to clip.exe:

PS> Get-Process | clip.exe

This may look strange but works, and when you paste the result into an editor, you do get back the result from Get-Process.

To make this line a bit more PowerShellish, add an alias:

PS> Set-Alias Out-Clipboard clip.exe
PS> Get-Process | Out-Clipboard

Twitter This Tip!
ReTweet this Tip!