Get-Clipboard

Gets the contents of the clipboard.

[!NOTE] > On Linux, this cmdlet requires the `xclip` utility to be in the path.

Syntax

Get-Clipboard
   [-Raw]
   [<CommonParameters>]

Description

The Get-Clipboard cmdlet gets the contents of the clipboard as text.

Examples

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

In this example we have copied the text "hello" into the clipboard.

Get-Clipboard

hello

Parameters

-Raw

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

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

Outputs

String