Quantcast
Channel: TechNet Blogs
Viewing all articles
Browse latest Browse all 17778

PowerTip: PowerShell One-Liner to Find Short Aliases

$
0
0

Summary:  Use this Windows PowerShell one-liner to find one-, two-, three-, and four-letter aliases.

Hey, Scripting Guy! Question How can I use a Windows PowerShell one-liner to find the number of default aliases that are one, two, three,
          and four letters long?

Hey, Scripting Guy! Answer Use the range operator to create an array with 1 through 4 numbers, pipe the results to the 
      Foreach-Object cmdlet, multiply the number with a wildcard character, and pipe the results to Measure:

1..4 | % {(gal ("?"*$_) | measure).count} 


Viewing all articles
Browse latest Browse all 17778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>