Best Practice: It is recommended to use approved verb for cmdlet, do not use unapproved verb.
PowerShell cmdlets use the syntax Verb-Noun.
Example: Get–Service (“Get” is the verb, “Service” is the noun).
By following the syntax convention Verb-Noun we can immediately know what is the purpose of the cmdlet.
- Get = Reads something
- Set = Writes something
- Test = Tests something
To get the list of approved verbs : Get-Verb
# Bad (Delete is not an approved verb)
# Good (Remove is an approved verb)
Note: When you import the SQL module, adding the “DisableNameChecking” parameter is used to suppress the warning about Encode-Sqlname and Decode-Sqlname. Indeed, “Encode” and “Decode” are not approved verbs (maybe they will be in the future but not until Powershell version 5.0.10105.0).
Import-Module -Name sqlps -DisableNameChecking