What is the best way to provide a unique PowerShell function name? Starting with version 1, the standard is to enter a short unique identifier after the dash of the verb and before the noun. For example, with my initials, I could create a Get-DWServer function; this is normal until someone creates a function in another module to get a reference to an object in the data store and uses the same function name. Two or three letters are simply not enough, but more than it seems ugly to read.
I would prefer to have a unique * prefix similar to .NET namespaces. This is better for the organization, easier on the eyes and works with tab completion. And it is elegantly expanding, so you can name it DW.Get-Server or DW.Network.Get-Server.
The disadvantage of this is that it starts validating the correct PowerShell verb while importing the / Export -ModuleMember module. You can get around this by specifying DisableNameChecking during import, but I'm wondering if this makes it sloppy and might be bad if PowerShell 3 comes out with a better solution. I know that purists of PS-verbs (are they?) Will complain that this probably “hinders the opening”, but I can't come up with a better option.
What do you do?
(* You can refer to the exported function using the name module_name \ function_name, but this will not work with the completion of the tab and still will not solve the problem of uniqueness of the function name).
source
share