Get-Clipboard
取得剪貼簿的內容。
語法
Default (預設值)
Get-Clipboard
[-Raw]
[<CommonParameters>]
Description
macOS 不支援此 cmdlet。
Get-Clipboard Cmdlet 會以文字的形式取得剪貼簿的內容。 多行文字會以類似 Get-Content的字串陣列傳回。
備註
在 Linux 上,此 Cmdlet 需要 xclip 公用程式位於路徑中。
範例
範例 1:取得剪貼簿的內容,並將其顯示至命令行
在此範例中,我們已將文字 「hello」 複製到剪貼簿。
Get-Clipboard
hello
參數
-Raw
取得剪貼簿的整個內容。 多行文字會以單一多行字串的形式傳回,而不是字串陣列。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
CommonParameters
此 Cmdlet 支援一般參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。