PoshCode Archive  Artifact [f10de23209]

Artifact f10de23209794ce4ed1da578c0b283624b1e5ea56b1a64fc05ad485bc61c087b:

  • File Get-Clipboard.ps1 — part of check-in [b4f1db4ee4] at 2018-06-10 14:05:10 on branch trunk — From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes (user: Lee Holmes size: 866)

# encoding: ascii
# api: powershell
# title: Get-Clipboard.ps1
# description: From Windows PowerShell Cookbook (O’Reilly) by Lee Holmes
# version: 0.1
# author: Lee Holmes
# license: CC0
# x-poshcode-id: 5972
# x-archived: 2016-05-24T22:21:49
# x-published: 2016-08-11T08:14:00
#
#
#############################################################################
##
## Get-Clipboard
##
## From Windows PowerShell Cookbook (O'Reilly)
## by Lee Holmes (http://www.leeholmes.com/guide)
##
##############################################################################

<#

.SYNOPSIS

Retrieve the text contents of the Windows Clipboard.

.EXAMPLE

PS >Get-Clipboard
Hello World

#>

Set-StrictMode -Version Latest

PowerShell -NoProfile -STA -Command {
    Add-Type -Assembly PresentationCore
    [Windows.Clipboard]::GetText()
}