stuncloud
12/22/2014 - 9:00 AM

Verb補完用エイリアス・改ですよ

Verb補完用エイリアス・改ですよ

diff @(Get-Alias | select Name) @(Get-Verb | select @{Name='Name';Expression={$_.Verb}}) -Property Name |
    ? {$_.SideIndicator -eq '=>'} | New-Alias -Value Set-DummyAlias -Option ReadOnly

function Set-DummyAlias {
    $MyCommandName = $MyInvocation.MyCommand.Name
    $InvocationName = $MyInvocation.InvocationName
    return Get-Command "$($InvocationName)*" | ? {
        $_.ResolvedCommandName -ne $MyCommandName
    }
}