Post

Handy #PowerShell one-liner of the day: Alphabetize whatever is on the clipboard: ~~~PowerShell @(@(Get-Clipboard) -split '(?>\r\n|\n)' | Sort-Object) -join [Environment]::NewLine | Set-Clipboard ~~~

0 reposts6 likes

Here's what I like. Add `-Unique` for distinct ~~~Powershell (Get-Clipboard -Raw) -split '\r?\n' | Sort-Object -Unique ~~~ Is there a difference with your regex and @() output? I appear to get the same results I tested mixing nested newlines in the array #Powershell