Function clip

Topics: Developer Forum
May 12, 2010 at 6:21 AM
Edited May 14, 2010 at 10:27 PM

I see there is Get-Clipboard and Out-Clipboard that work with (obviously) clipboard.


Have you considered something like function clip that acts depending on context? It would be called like this:

(clip) -replace '\d+','n' | clip
If called without params, it uses Get-Clipboard, if with params then Out-Clipboard. I found it useful many times, because I don't need to remember the aliases and it is pretty obvious.

Coordinator
May 14, 2010 at 6:00 PM
But in your example (clip) is called without parameters so such a function would perform a out-clipboard instead of the intended get-clipboard.
May 14, 2010 at 10:26 PM
Edited, my mistake :/