Getting Alphabetical Listings

by Sep 13, 2010

Unfortunately, PowerShells special ".." operator only supports numeric ranges:

1..10

You can use type conversion to get a range of letters:

$OFS = ","
[string][char[]](65..90)

This will then create a comma-separated list of letters from "A" to "Z."

Twitter This Tip! ReTweet this Tip!