Commands / Text and objects

Get-Clipboard

Read what is on the clipboard

beginner Text and objects Aliases gcb

Get-Clipboard
 Get-Clipboard
Works on
WindowsLinuxmacOS
PowerShell
5.1 and later
Reference
Microsoft Learn: Get-Clipboard

Returns the clipboard text, one line per string. Handy for cleaning up a list someone pasted you in chat.

Try this

Copy a list of names, then remove blanks and duplicates and put it back:

Get-Clipboard |
    ForEach-Object { $_.Trim() } |
    Where-Object { $_ } |
    Sort-Object -Unique |
    Set-Clipboard

Coming from another shell

ShellWhat you might type
bash / zshpbpaste

More in From bash and From cmd.

Related commands