Table of contents
ISE
TOC
Collapse the table of content
Expand the table of content

Get-Clipboard

JuanPablo Jofre|Last Updated: 12/17/2016
|
3 Contributors

SYNOPSIS

Gets the current Windows clipboard entry.

SYNTAX

Get-Clipboard [-Format <ClipboardFormat>] [-TextFormatType <TextDataFormat>] [-Raw] [<CommonParameters>]

DESCRIPTION

The Get-Clipboard cmdlet gets the current Windows clipboard entry.

EXAMPLES

Example 1: Get the content of the clipboard and display it to the command-line

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

This command displays the contents of the clipboard to the command-line.

Example 2: Get the content of the clipboard and display it to the command-line

PS C:\> Get-Clipboard
http://upload.wikimedia.org/wikipedia/en/7/7f/Windows_PowerShell_icon.png

This command displays the link, as a URL, of the image that is stored in the clipboard.

PARAMETERS

-Format

Specifies the type, or format, of the clipboard. The acceptable values for this parameter are:

  • Text
  • FileDropList
  • Image
  • Audio
Type: ClipboardFormat
Parameter Sets: (All)
Aliases: 
Accepted values: Text, FileDropList, Image, Audio

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Raw

Indicates that this cmdlet ignores newline characters and gets the entire contents of the clipboard.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: 

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TextFormatType

Specifies the text data format type of the clipboard. The acceptable values for this parameter are:

  • Text
  • UnicodeText
  • Rtf
  • Html
  • CommaSeparatedValue
Type: TextDataFormat
Parameter Sets: (All)
Aliases: 
Accepted values: Text, UnicodeText, Rtf, Html, CommaSeparatedValue

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

System.String, System.IO.FileInfo, System.IO.Stream, System.Drawing.Image

NOTES

Set-Clipboard

© 2017 Microsoft