- Microsoft.PowerShell.Core\Get-Command $args[0] |
- sort {
- if($_.CommandType -match "ExternalScript|Application") {
- 1000 + [array]::IndexOf( (Get-Content Env:Path).Split(";"),
- [IO.Path]::GetDirectoryName($_.Definition) )
- } else {
- [int]$_.CommandType
- }
- }