Running Cmdlets without Verb

by Mar 21, 2017

This has been part of PowerShell since version 1.0: cmdlets with verb „get“ can be invoked without the verb. So instead of „Get-Service“, you can run „Service“, and instead of „Get-Date“, you can run „Date“.

These are no aliases, and apparently even the PowerShell engine does not know why this works. Try running these:

PS> Date
PS> Get-Command Date

This shortcut requires that no colliding command or language element exists. That’s why you can run „Get-Process“, but you cannot run „Process“: „Process“ is a reserved word in the PowerShell language.

Twitter This Tip! ReTweet this Tip!