Search code examples
powershellnaming-conventions

Best Powershell verb to indicate Validation?


I often have a method that validates a particular value. In PowerShell, the convention is to use a verb within the Get-Verb list, but I am puzzled on which one would be best for this usage.

Alternatively, if my design architecture should change to avoid validation through a method in some other manner I would welcome suggestions along that line too.

Verbs that are roughly related are: Ensure, Compare, Edit, Convert, Initialize, Update, Assert, Confirm, Measure, Resolve, Test, Write, Grant, Use.


Solution

  • Use "Test"

    The appropriate verb for validating a value is Test. Quoting from the Approved Verbs list (section Diagnostic Verbs):

    Verb (alias)   Action                       Synonyms to avoid
    ...            ...                          ...
    Test (t)       Verifies the operation or    Diagnose, Analyze,
                   consistency of a resource.   Salvage, Verify