How to copy stdout to the clipboard in Powershell
Suppose you want to copy the output of a Powershell command to the clipboard. Instead of making a mess of selecting the output in the terminal and copying, just pipe the output to clip
.
For example to copy your path environment variable to the clipboard run:
|
|
The same can also be achieved using Set-Clipboard
:
|
|
To read the contents of the clipboard use Get-Clipboard
:
|
|