evetsleep

Out-Clipboard

May 18th, 2012
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function Out-Clipboard
  2.     {
  3.     param($text)
  4.     Add-Type -AssemblyName System.Windows.Forms
  5.     $tb = New-Object System.Windows.Forms.TextBox
  6.     $tb.Multiline = $true
  7.      
  8.     if ($Input -ne $null)
  9.         {
  10.         $Input.Reset()
  11.         $tb.Text = $Input | Out-String
  12.         }
  13.     else
  14.         {
  15.         $tb.Text = $text
  16.         }
  17.        
  18.     $tb.SelectAll()
  19.     $tb.Copy()
  20.     }
Advertisement
Add Comment
Please, Sign In to add comment