Powershell - Get-ClipBoard Set-Clipboard

2010/06/15 | less than 1 minute read |


function Get-ClipBoard {
 Add-Type -AssemblyName System.Windows.Forms
 $tb = New-Object System.Windows.Forms.TextBox
 $tb.Multiline = $true $tb.Paste()
 $tb.Text
}
function Set-ClipBoard($text) {
 Add-Type -AssemblyName System.Windows.Forms
 $tb = New-Object System.Windows.Forms.TextBox
 $tb.Multiline = $true $tb.Text = $text $tb.SelectAll()
 $tb.Copy()
}</code>
```

```

```

Leave a comment