Verb and Noun

This topic contains 4 replies, has 4 voices, and was last updated by Profile photo of Tim Pringle Tim Pringle 1 year, 10 months ago.

  • Author
    Posts
  • #22214
    Profile photo of
    Anonymous

    Guys,
    How can I define which is verb and noun in my script? skeleton of my .psm1 would be as below.

    Function Get-Foo
    {
    [cmdLetBinding()]
    BEGIN{}
    PROCESS{}
    END
    }

  • #22215
    Profile photo of Dave Wyatt
    Dave Wyatt
    Moderator

    PowerShell does that automatically, as long as your function name contains a hyphen. Everything before the hyphen is the verb, everything after the hyphen is the noun.

  • #22218
    Profile photo of Matt McNabb
    Matt McNabb
    Participant

    'Get' is a verb and 'Foo' is a noun.

  • #22219
    Profile photo of
    Anonymous

    thx team. understood.

  • #22250
    Profile photo of Tim Pringle
    Tim Pringle
    Participant

    Just as an addition, PowerShell best practice recommends using a naming convention for the verb part from an 'approved' list. It's quite an extensive list .

    I've only found one situation where I was really struggling to choose the verb, and at the end of the day because my noun part wasn't particularly good.

    You can get a list of these verbs via :

    Get-Verb
    

You must be logged in to reply to this topic.