Files
cheatsheet-tldr/tldr/windows/set-clipboard
2026-01-08 00:22:45 +00:00

31 lines
772 B
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
syntax: markdown
tags: [tldr, windows]
source: https://github.com/tldr-pages/tldr.git
---
# Set-Clipboard
> PowerShell command to set content to clipboard.
> Note: `scb` can be used as an alias for `Set-Clipboard`.
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-clipboard>.
- Copy text to the clipboard:
`Set-Clipboard -Value "{{text}}"`
- Copy multiple texts to clipboard separated by new line:
`Set-Clipboard -Value @("{{text 1}}", "{{text 2}}", "{{text 3}}")`
- Copy files or directories to clipboard:
`Set-Clipboard -Path "{{path o iles_or_directories}}"`
- Copy multiple files:
`Set-Clipboard -Path "{{path o ile1}}","{{path o ile2}}","{{path o ile3}}"`
- Clear the clipboard:
`Set-Clipboard ""`