< Back

Set-Clipboard

Tue Jan 29, 2019 10:20 pm

NAME Set-Clipboard



SYNOPSIS

Sets the current Windows clipboard entry.





SYNTAX

Set-Clipboard [-Append] [-AsHtml] [-Confirm] -LiteralPath <String[]> [-WhatIf] [<CommonParameters>]



Set-Clipboard [-Append] [-AsHtml] [-Confirm] -Path <String[]> [-WhatIf] [<CommonParameters>]



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





DESCRIPTION

The Set-Clipboard cmdlet sets the current Windows clipboard entry.





PARAMETERS

-Append [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-AsHtml [<SwitchParameter>]

Indicates that the cmdlet renders the content as HTML to the clipboard.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-LiteralPath <String[]>

Specifies the path to the item that is copied to the clipboard. Unlike Path , the value of LiteralPath is used exactly as it is typed. No

characters are interpreted as wildcards. If the path includes escape characters, enclose it in single quotation marks. Single quotation marks

tell Windows PowerShell not to interpret any characters as escape sequences.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Path <String[]>

Specifies the path to the item that is copied to the clipboard. Wildcard characters are permitted.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Value <String[]>

Specifies, as a string array, the content to copy to the clipboard.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String[]







OUTPUTS



NOTES









Example 1: Copy text to the clipboard



PS C:\\>Set-Clipboard -Value "This is a test string"



This command copies a string to the clipboard.

Example 2: Copy the contents of a directory to the clipboard



PS C:\\>Set-Clipboard -Path "C:\\Staging\\"



This command copies the content of the specified folder to the clipboard.



RELATED LINKS

Online Version: http://go.microsoft.com/fwlink/?LinkId=526220

Get-Clipboard