2025-12-16 10:20:31 -07:00
|
|
|
# Set-Clipboard
|
|
|
|
|
|
|
|
|
|
> PowerShell command to set content to clipboard.
|
|
|
|
|
> Note: `scb` can be used as an alias for `Set-Clipboard`.
|
2026-02-18 06:55:01 -07:00
|
|
|
> More information: <https://learn.microsoft.com/powershell/module/microsoft.powershell.management/set-clipboard>.
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- 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:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`Set-Clipboard -Path "{{path\to\files_or_directories}}"`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Copy multiple files:
|
|
|
|
|
|
2026-02-18 06:55:01 -07:00
|
|
|
`Set-Clipboard -Path "{{path\to\file1}}","{{path\to\file2}}","{{path\to\file3}}"`
|
2025-12-16 10:20:31 -07:00
|
|
|
|
|
|
|
|
- Clear the clipboard:
|
|
|
|
|
|
|
|
|
|
`Set-Clipboard ""`
|