PowerShell Quick Tip: Sending things to the clipboard

If you have a variable that you’d like to grab the value of and put it into the clipboard, the easiest way to do this is to pipe it to the built-in clip.exe

For example:

$env:Path | clip

The above will result in the contents of the ‘path’ environment variable being put into the clipboard.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s