2007/06/17

ダッチさんのメソッド名ランキングにインスパイアされてPowerShellのコマンドレットではどうなのかというのをやってみました。

get-command |group-object verb|sort count -descending

結果

Count Name                      Group
----- ----                      -----
   29 Get                       {Get-Acl, Get-Alias, Get-AuthenticodeSignatu...
   13 Set                       {Set-Acl, Set-Alias, Set-AuthenticodeSignatu...
    8 New                       {New-Alias, New-Item, New-ItemProperty, New-...
    7 Write                     {Write-Debug, Write-Error, Write-Host, Write...
    6 Out                       {Out-Default, Out-File, Out-Host, Out-Null...}
    5 Remove                    {Remove-Item, Remove-ItemProperty, Remove-PS...
    4 Add                       {Add-Content, Add-History, Add-Member, Add-P...
    4 Format                    {Format-Custom, Format-List, Format-Table, F...
    4 Clear                     {Clear-Content, Clear-Item, Clear-ItemProper...
    4 Export                    {Export-Alias, Export-Clixml, Export-Console...
    3 Invoke                    {Invoke-Expression, Invoke-History, Invoke-I...
    3 Start                     {Start-Service, Start-Sleep, Start-Transcript}
    3 Stop                      {Stop-Process, Stop-Service, Stop-Transcript}
    3 Import                    {Import-Alias, Import-Clixml, Import-Csv}
    2 ConvertTo                 {ConvertTo-Html, ConvertTo-SecureString}
    2 Copy                      {Copy-Item, Copy-ItemProperty}
    2 Update                    {Update-FormatData, Update-TypeData}
    2 Select                    {Select-Object, Select-String}
    2 Rename                    {Rename-Item, Rename-ItemProperty}
    2 Move                      {Move-Item, Move-ItemProperty}
    2 Measure                   {Measure-Command, Measure-Object}
    1 Sort                      {Sort-Object}
    1 Where                     {Where-Object}
    1 Tee                       {Tee-Object}
    1 Split                     {Split-Path}
    1 Test                      {Test-Path}
    1 Trace                     {Trace-Command}
    1 Suspend                   {Suspend-Service}
    1 ForEach                   {ForEach-Object}
    1 Group                     {Group-Object}
    1 Join                      {Join-Path}
    1 Compare                   {Compare-Object}
    1 ConvertFrom               {ConvertFrom-SecureString}
    1 Convert                   {Convert-Path}
    1 Resolve                   {Resolve-Path}
    1 Restart                   {Restart-Service}
    1 Resume                    {Resume-Service}
    1 Pop                       {Pop-Location}
    1 Push                      {Push-Location}
    1 Read                      {Read-Host}

やはりGetが多いですね。対応してSetも多いです。結果は普通ですが一行のコマンドでこんなことが分かるのが面白いでしょ?

元記事:http://blogs.wankuma.com/mutaguchi/archive/2007/06/17/81041.aspx

古い記事へ | 新しい記事へ


プライバシーポリシー

Twitter

Books