Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 23rd, 2012  |  syntax: None  |  size: 0.29 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Microsoft.PowerShell.Core\Get-Command $args[0] |
  2. sort {
  3.   if($_.CommandType -match "ExternalScript|Application") {
  4.      1000 + [array]::IndexOf( (Get-Content Env:Path).Split(";"),
  5.                               [IO.Path]::GetDirectoryName($_.Definition) )
  6.   } else {
  7.      [int]$_.CommandType
  8.   }
  9. }