“It’s the time for lists”, I read somewhere today. Sure, that is true. But blogging little lists isn’t much fun.

So, I will let you generate your very own TOP 10 list. Use the following Powershell Oneliner to get a TOP 10 list of your most frequently used cmdlets in your scripts. (Remember to modify the path to your script storage location.)

Happy Holidays!

Get-ChildItem D:Scripts -Filter *.ps1 -Recurse |
 Select-String (Get-Command|%{$_.Name}) |
 Group Pattern |
 Sort Count -Descending |
 Select -First 10 |
 Format-Table Name, Count -AutoSize

»crosslinked«

No related posts.

  One Response to “TOP 10 Commandlets in a Oneliner”

  1. Very fun! And interesting! I don’t have many scripts, so my numbers are low, but… My results:

    Name Count
    —- —–
    Write-Host 762
    New-Object 362
    Add-Member 59
    Get-Date 57
    Start-Sleep 38
    Read-Host 31
    ForEach-Object 28
    Remove-Variable 26
    Test-Path 25
    Get-WmiObject 20

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2012 PeetersOnline Suffusion theme by Sayontan Sinha