Powershell - Copy to clipboard

To support me, you can subscribe to the channel, share and like the videos, disable your ad blocker or make a donation. Thank you!

Hello,

It is sometimes interesting to return the result of an instruction directly to the clipboard and then paste it into the desired location.
This can be done simply by using clip or Set-Clipboard

# Retrieving the exception ID directly from the clipboard.
$error[0].Exception.GetType().fullname | clip
# or (without line feed at the end)
$error[0].Exception.GetType().fullname | Set-Clipboard

Related links