Set-Clipboard

Sets the contents of the clipboard.

Syntax

Set-Clipboard
   [-Value] <string[]>
   [-Append]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-Clipboard cmdlet sets the contents of the clipboard.

[!NOTE]

On Linux, this cmdlet requires the xclip utility to be in the path.

Examples

Example 1: Copy text to the clipboard

Set-Clipboard -Value "This is a test string"

Parameters

-Append

Indicates that the cmdlet does not clear the clipboard and appends content to it.

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

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Accept pipeline input:False
Accept wildcard characters:False
-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

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

Inputs

System.String[]