Skip to content

approved-verbs

Reports a function named Verb-Noun whose verb is not one that Get-Verb returns. A name without a dash is not checked.

PowerShell users find commands by verb (Get-Command -Verb Get) and expect a verb to mean the same in every module. An unapproved verb such as Make- or Delete- also makes Import-Module print a warning about the module’s names.

To fix, rename the function with an approved verb (New-, Remove-).

Reported
function Fetch-Data {
param(
...
}
function Get-Thing { }
function Fetch { }
function global:Make-Thing { }
...
powershell:
lint:
rules:
approved-verbs: warn # off (default), warn, error

Enabled by the presets: powershell/psscriptanalyzer.

Suppress one line with sudsy-disable-next-line approved-verbs in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
psscriptanalyzer PSUseApprovedVerbs partial Names without a dash are not checked; the verb list is fixed and cannot follow the host.