Get-Clipboard

Get the current Windows clipboard entry.

Syntax
      Get-Clipboard [-Format ClipboardFormat] [-TextFormatType TextDataFormat] [-Raw]
         [CommonParameters]

Key
   -Format ClipboardFormat
       The type, or format, of the clipboard.
       Acceptable values for this are:   Text, FileDropList, Image, Audio

   -Raw
       Ignore newline characters and get the entire content of the clipboard.

   -TextFormatType TextDataFormat
       The text data format type of the clipboard.
       Acceptable values for this are:   Text, UnicodeText, Rtf, Html, CommaSeparatedValue

   CommonParameters:
       -Verbose, -Debug, -ErrorAction, -ErrorVariable, -WarningAction, -WarningVariable,
       -OutBuffer, -PipelineVariable -OutVariable.

Standard Aliases for Get-Clipboard: none, but if you want to add a short alias like clip, set it with set-alias

Examples

Get the content of the clipboard and display it on the command-line:

PS C:\>Get-Clipboard
This is a test string

Display the link, as a URL, of an image that is stored in the clipboard:

PS C:\> Get-Clipboard
https://en.wikipedia.org/wiki/PowerShell#/media/File:PowerShell_Core_6.0_icon.png

“O nation, that thou couldst remove! That Neptune's arms, who clippeth thee about, Would bear thee from the knowledge of thyself” ~ King John (Act 5 Scene 2) - Shakespeare

Related PowerShell Cmdlets:

Set-Clipboard - Set the current Windows clipboard entry.
Equivalent CMD command: CLIP


 
Copyright © SS64.com 1999-2019
Some rights reserved