is this "feature" documented?


i got tired of typing long commands test function developing, added test function switch statement select available tests. able use this:

    test 3

a while later went make changes couldn't find function called test. remembered that, out of habit, i had used verb-noun-compliant name "get-test" , forgotten doing that. never gave second thought, after being able invoke function name "test".

i theorized perhaps unrecognized command might cause powershell try prefixing "get-" name rather throwing error. seems work cmdlets, these example:

acl = get-acl  alias = get-alias  childitem = get-childitem

although "history" seems resolve "get-history", because defined alias cmdlet. if "feature" intended, appears not have been trusted. tried deleting "history" alias , found seemed resolve "get-history" according "feature".

"command" resolves "command.com" rather get-command, appear powershell first checks presence of executable of given name in path.

seems potentially cool shortcut, there @ least 1 more problematic gotcha: "process" not resolve "get-process" command has mandatory parameter. "help process" lists 5 process-related cmdlets. of these have (optional) "id" parameter, tried "process -id 5800" (that id of existing process). resulted in following error message:

ps m:\> process -id 5800  missing statement block after process ( condition ).  @ line:1 char:8  + process <<<<  -id 5800      + categoryinfo          : parsererror: (:) [], parentcontainserrorrecordexception      + fullyqualifiederrorid : missingstatementblock  ps m:\>

if worked consistently, might marginally useful. is, aliases seem provide more manageable approach shortcut names commands.

so guess question is:

is documented or unintented "feature"?


al dunbar

run trace on it, you'll see ps cycles through few options find
the right cmdlet.. pretty cool, not sure officially documented,
yeah, intended :)
 
 

justin rich
http://jrich523.wordpress.com
powershell v3 guide (technet)
please remember mark replies answers if , unmark them if provide no help.


Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group