| title |
CopyTextCommand Class |
| description |
The CopyTextCommand class is used to define a command that copies text to the clipboard. |
| ms.date |
2/25/2025 |
| ms.topic |
reference |
| no-loc |
PowerToys |
Windows |
Insider |
|
Namespace: Microsoft.CommandPalette.Extensions.Toolkit
Inherits InvokableCommand
The CopyTextCommand class is used to define a command that copies text to the clipboard. It is a specialized command that provides functionality for copying text and displaying a result message in the Command Palette.
| Constructor |
Description |
| CopyTextCommand(String) |
Initializes the command with a text parameter, sets its name to "Copy", and adds an icon. |
| Method |
Description |
| Invoke() |
Sets the clipboard text to the value of Text and returns the Result. |