Naming functions
As we saw in the previous recipes, functions can be used like we use cmdlets. When we define parameters, they can be used along with the function, just like how we use parameters with cmdlets. Therefore, it is a convention to name the functions in the Verb-Noun format as well. This way, it is almost intuitive to use them, since we are used to cmdlets now. Also, when these functions are packed into a module and shared, they can, again, be used just like cmdlets.
It is natural for us to create functions in the conventional form—how we do it in other programming languages—however, naming the PowerShell functions the PowerShell way would make things easier for everyone who uses your functions. Also, after loading the modules, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access