Get Clipboard - PowerShell


The Get-Clipboard command retrieves the contents of the system’s clipboard, the temporary storage location for copied data. It is primarily used to access text, images, or other data that has been previously copied or cut.


Get-Clipboard [-Text] [-Image] [-DataType] [-Format <string>]



  • Returns only the text content of the clipboard.
  • Default: $false


  • Returns only the image content of the clipboard.
  • Default: $false


  • Retrieves the data type of the clipboard contents.
  • Default: System.String


  • Specifies the format of the output.
  • Available values: Text, Image, DataType
  • Default: Text for text content, Image for image content, DataType for data type


Get clipboard text

Get-Clipboard -Text

Get clipboard image

Get-Clipboard -Image

Get clipboard data type

Get-Clipboard -DataType

Customize output format

# Get clipboard image in PNG format
Get-Clipboard -Image -Format PNG

Common Issues

Clipboard is empty

If the clipboard has no content, the command will return an empty string.


Get-Clipboard can be integrated with other commands to perform advanced tasks, such as:

  • Save clipboard image to a file:
Get-Clipboard -Image -Format PNG | Set-Content -Path "ClipboardImage.png"
  • Set-Clipboard: Sets the contents of the clipboard.
  • Clear-Clipboard: Clears the contents of the clipboard.