• 1. London, UK
  • 2. New York, NY
  • 3. Sydney, Australia
  • 4. Melbourne, Australia
  • 5. Moscow, Russia
  • 6. Singapore
  • 7. Paris, France
  • 8. Chicago, IL
  • 9. Hong Kong
  • 10. Houston, TX

Monday, December 24, 2007

 

Reader Tip: Redirecting shell output to the clipboard

Posted by Bharat Suneja at 1:56 PM
Exchangepedia reader Guamaniac has an interesting tip in the comments on "Exchange 2007 Content Filter: The Whitelist Is Here!":
Get-ContentFilterConfig should give you a list of all the content filter settings on that particular Transport server.

And I know this is the simplest of features in PowerShell, but I just love the fact that you can pipe output to the clipboard:

get-contentfilterconfig | clip

and then peruse in your favorite text editor!
I'm used to simply highlighting the output using the mouse (which adds it to the clipboard). You need to enable QuickEdit on the command prompt window to be able to use this cut-and-paste functionality..

Labels: ,

2 Comments:

December 25, 2007 12:46 AM
Blogger $hay@Israel said...

FYI, there is no built-in cmdlet in PowerShell to redirect text to the clipboard. The suggested tip is probably using a custom exe file (clip) to copy the get-contentfilterconfig to the clipboard. One thing though, PowerShell Community Extensions (PSCX) do have a cmdlet called "Out-Clipboard". You can download PSCX at: http://www.codeplex.com/PowerShellCX.

 
December 26, 2007 9:07 AM
Blogger Bharat Suneja said...

- Afaik, it doesn't use any custom code or EXE. (Works "out-of-the-box".)
- It redirects the entire output from the command to the clipboard, similar to the known method of redirecting command output to a file (from DOS days) using:
COMMAND-NAME > mytextfile.txt

 

Post a Comment

Links to this post:

Create a Link

<< Home