Copy to the Clipboard With Set-Clipboard
Send command output straight to the Windows clipboard.
Run "text" | Set-Clipboard to copy the text, then paste it anywhere.
01Command
Command
$ "hello from cmdcv" | Set-Clipboard02What 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
!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-ClipboardEvidence: Copies string or file content to the Windows clipboard.
Last verified: 2026-09-20 · Category: System & Settings
06Related solutions
Grep on Windows: Select-String
Search inside text files and logs with regex, returning file, line number and match.
Zip Files with Compress-Archive
Create or update a .zip from any files or folder contents straight from PowerShell.
Test a TCP port connection on Windows with Test-NetConnection
A built-in PowerShell one-liner that answers 'is port 5432/3389/443 actually open through this network?' — no telnet client needed.