So to address this, I threw the following small function into my profile:
1
|
function cc { r | scb } |
Now PowerShell 5.0 is needed to evoke this. Specifically for use of Set-Clipboard. Let’s now break down the workings of the small function.
First, I’m defining a function named cc which is not a properly named PowerShell function but for now it will do the trick. Its assigned r | scb in which r is an alias for Invoke-History which re-runs the last command typed. Try it yourself:
1
2
3
4
5
6
7
8
9
10
|
PS G:\> write-output "hah!" hah! PS G:\> r write-output "hah!" hah! PS G:\> r write-output "hah!" hah! |
Last but not least scb is an alias for Set-Clipboard which means whatever came out of the last command will be the new contents of your clipboard.
Source: CANITPRO
Related posts
Reviews
SAMSUNG GALAXY S8 PLUS
The Samsung Galaxy S8 Plus is a beautifully crafted smartphone with nearly no bezel, curvaceous in design and reflects a…
How to: Connect to Exchange Online Using Multi-Factor Authentication
Using PowerShell to manage your Microsoft cloud services like Exchange Online and using multi-factor authentication (MFA) separately is awesome. Using…
Stay connected