Copy to the Clipboard With Set-Clipboard

Send command output straight to the Windows clipboard.

WindowspowershellclipboardproductivityLow risk
Run "text" | Set-Clipboard to copy the text, then paste it anywhere.

01Command

Command
$ "hello from cmdcv" | Set-Clipboard

02What it does

Set-Clipboard takes pipeline input and places it on the Windows clipboard, so you can copy command output without selecting text. Pipe a file with Get-Content, or a command result, and it is ready to paste into a chat or editor.

03Risk

RiskLow risk
RequirementsWindows 10/11 with PowerShell 5.1 or PowerShell 7+
!Warning: The clipboard is shared system-wide and may be synchronized to other devices; do not copy secrets on shared machines.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Set-Clipboard
    Microsoft Learn · vendor-doc · 2026-09-20
    Evidence: Copies string or file content to the Windows clipboard.

Last verified: 2026-09-20 · Category: System & Settings

06Related solutions