CmdID / PowerShell / Cmdlets / Set
Set-Clipboard
Sets the current Windows clipboard entry. PowerShell reference
From the PowerShell reference
7 parameters
Alias scb
What it does
Sets the current Windows clipboard entry. The Set-Clipboard cmdlet sets the current Windows clipboard entry.
Set-Clipboard [-Append] [-AsHtml] [-WhatIf] [-Confirm] [<CommonParameters>]Set-Clipboard [-Value] <String[]> [-Append] [-AsHtml] [-WhatIf] [-Confirm] [<CommonParameters>]Set-Clipboard [-Append] -Path <String[]> [-AsHtml] [-WhatIf] [-Confirm] [<CommonParameters>]Set-Clipboard [-Append] -LiteralPath <String[]> [-AsHtml] [-WhatIf] [-Confirm] [<CommonParameters>]
Copy text to the clipboard
Set-Clipboard -Value "This is a test string"IdentifyCopy the contents of a directory to the clipboard
Set-Clipboard -Path "C:\Staging\"IdentifyCopy the contents of a file to the clipboard
Get-Content C:\Users\user1\.ssh\id_ed25519.pub | Set-ClipboardIdentifyIts page in the reference: Set-Clipboard.
Parameters
-AppendIndicates that the cmdlet should add to the clipboard instead of replacing it. By default, the cmdlet clears the current content from the clipboard and sets it to the new content. When this parameter is specified, the cmdlet appends the new content after a newline to the current content.-AsHtmlIndicates that the cmdlet renders the content as HTML to the clipboard.-LiteralPathSpecifies the path to the item that's copied to the clipboard. Unlike Path, the value of LiteralPath is used exactly as it's written. 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.-PathSpecifies the path to the item that's copied to the clipboard. Wildcard characters are permitted.-ValueSpecifies, as a string array, the content to copy to the clipboard.-ConfirmPrompts you for confirmation before running the cmdlet.-WhatIfShows what would happen if the cmdlet runs. The cmdlet isn't run.