Get-Clipboard
Gets the current Windows clipboard entry.
Синтаксис
Default (по умолчанию)
Get-Clipboard
[-Format <ClipboardFormat>]
[-TextFormatType <TextDataFormat>]
[-Raw]
[<CommonParameters>]
Описание
The Get-Clipboard
cmdlet gets the current Windows clipboard entry. Multiple lines of text are
returned as an array of strings similar to Get-Content
.
Примеры
Example 1: Get the content of the clipboard and display it to the command-line
In this example we have right-clicked on an image in a browser and chose the Copy action. The following command displays the link, as a URL, of the image that is stored in the clipboard.
Get-Clipboard
https://en.wikipedia.org/wiki/PowerShell
Example 2: Get the content of the clipboard in a specific format
In this example we copied files to the clipboard in Windows Explorer by selecting them and pressing Ctrl-C. Using the following command, you can access the contents of the clipboard as a list of files:
Get-Clipboard -Format FileDropList
Directory: C:\Git\PS-Docs\PowerShell-Docs\wmf
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 5/7/2019 1:11 PM 10010 TOC.yml
-a---- 11/18/2016 10:10 AM 53 md.style
-a---- 5/6/2019 9:32 AM 4177 overview.md
-a---- 6/28/2018 2:28 PM 345 README.md
Параметры
-Format
Specifies the type, or format, of the clipboard. The acceptable values for this parameter are:
- Text
- FileDropList
- Image
- Audio
Свойства параметра
Тип: | ClipboardFormat |
Default value: | None |
Допустимые значения: | Text, FileDropList, Image, Audio |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Наборы параметров
(All)
Position: | Named |
Обязательно: | False |
Значение из конвейера: | False |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
-Raw
Gets the entire contents of the clipboard. Multiline text is returned as a single multiline string rather than an array of strings.
Свойства параметра
Тип: | SwitchParameter |
Default value: | None |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Наборы параметров
(All)
Position: | Named |
Обязательно: | False |
Значение из конвейера: | False |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
-TextFormatType
Specifies the text data format type of the clipboard. The acceptable values for this parameter are:
- Text
- UnicodeText
- Rtf
- Html
- CommaSeparatedValue
Свойства параметра
Тип: | TextDataFormat |
Default value: | None |
Допустимые значения: | Text, UnicodeText, Rtf, Html, CommaSeparatedValue |
Поддерживаются подстановочные знаки: | False |
DontShow: | False |
Наборы параметров
(All)
Position: | Named |
Обязательно: | False |
Значение из конвейера: | False |
Значение из конвейера по имени свойства: | False |
Значение из оставшихся аргументов: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Входные данные
None
You can't pipe objects to this cmdlet.
Выходные данные
String
FileInfo
Stream
Image
Примечания
Windows PowerShell includes the following aliases for Get-Clipboard
:
gcb