function Get-ClipboardText { #http://www.nivot.org/post/2009/10/14/PowerShell20GettingAndSettingTextToAndFromTheClipboard $command = { add-type -an system.windows.forms [System.Windows.Forms.Clipboard]::GetText() } powershell -sta -noprofile -command $command } (Get-ClipBoardText).tostring().Split("`r`n|`r|`n",[System.StringSplitOptions]::RemoveEmptyEntries) | Sort| clip