IT Questions and Answers :)

Wednesday, February 24, 2021

What is the common naming convention of PowerShell cmdlets and functions?

What is the common naming convention of PowerShell cmdlets and functions?

  • Verb-Preposition-Noun
  • Adverb-Verb-Noun
  • Verb-Noun
  • Adjective-Noun    

What is the common naming convention of PowerShell cmdlets and functions?


EXPLANATION

The common naming convention of cmdlets and functions in PowerShell is "Verb-Noun".

There are 3 primary rules for naming within this convention:

  1. The Verb should be in the approved verb list.  To get the list of approved verbs, simply type "Get-Verb" in PowerShell.
  2. The Noun should be singular, never plural.
  3. Matching Nouns should work together and with the same object types; for instance, the object you get when you run Get-<Noun> should be able to be piped to a cmdlet to Set-<Noun>.
           
Share:

0 comments:

Post a Comment

Popular Posts